aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2016-07-15 08:06:25 +0200
committerMichael Mann <mmann78@netscape.net>2016-07-15 12:32:09 +0000
commite9961223d4d32675a1d1d874f9c775d36be5c80b (patch)
tree2883aa7761043c7631952f8d1f2464d420786108
parent7533c72c4bfd206a59f5819098d3b479f6646b7b (diff)
Bluetooth: RFCOMM: Fix CID 1364086
Fix null pointer dereferences. Change-Id: Id095fd0d7c9d70f79fd7367ef5c226f271a24cbe Reviewed-on: https://code.wireshark.org/review/16466 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-btrfcomm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/epan/dissectors/packet-btrfcomm.c b/epan/dissectors/packet-btrfcomm.c
index 01abbd9cd9..9dbc83d736 100644
--- a/epan/dissectors/packet-btrfcomm.c
+++ b/epan/dissectors/packet-btrfcomm.c
@@ -853,7 +853,8 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
rfcomm_data->remote_bd_addr_oui = l2cap_data->remote_bd_addr_oui;
rfcomm_data->remote_bd_addr_id = l2cap_data->remote_bd_addr_id;
- if (service_info->uuid.size != 0 && p_get_proto_data(pinfo->pool, pinfo, proto_bluetooth, PROTO_DATA_BLUETOOTH_SERVICE_UUID) == NULL) {
+ if (service_info && service_info->uuid.size != 0 &&
+ p_get_proto_data(pinfo->pool, pinfo, proto_bluetooth, PROTO_DATA_BLUETOOTH_SERVICE_UUID) == NULL) {
guint8 *value_data;
value_data = wmem_strdup(wmem_file_scope(), print_numeric_uuid(&service_info->uuid));
@@ -863,9 +864,9 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (!dissector_try_uint_new(rfcomm_dlci_dissector_table, (guint32) dlci,
next_tvb, pinfo, tree, TRUE, rfcomm_data)) {
- if (service_info->uuid.size == 0 ||
+ if (service_info && (service_info->uuid.size == 0 ||
!dissector_try_string(bluetooth_uuid_table, print_numeric_uuid(&service_info->uuid),
- next_tvb, pinfo, tree, rfcomm_data)) {
+ next_tvb, pinfo, tree, rfcomm_data))) {
decode_by_dissector = find_proto_by_channel(dlci >> 1);
if (rfcomm_channels_enabled && decode_by_dissector) {
call_dissector_with_data(decode_by_dissector, next_tvb, pinfo, tree, rfcomm_data);