aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-btsdp.c
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2015-05-27 15:37:42 +0200
committerMichal Labedzki <michal.labedzki@tieto.com>2015-06-12 08:49:12 +0000
commita2207613b7c1818af960afc32d5c62c104792f01 (patch)
treee59b10f7a87520f0b2bc9c77e8f1377bd0711025 /epan/dissectors/packet-btsdp.c
parent1d0d82a4425da9703b71d5f17c46895aa9c7d6f9 (diff)
Bluetooth: SDP: Fix alone DID attributes
Fix "malformed" packets where there is only one attribute of DID. Change-Id: If71ec66e09edbb7c1ca2ebf97acbf65cc52ab038 Reviewed-on: https://code.wireshark.org/review/8898 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'epan/dissectors/packet-btsdp.c')
-rw-r--r--epan/dissectors/packet-btsdp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/dissectors/packet-btsdp.c b/epan/dissectors/packet-btsdp.c
index daeeccbc8d..23eedead74 100644
--- a/epan/dissectors/packet-btsdp.c
+++ b/epan/dissectors/packet-btsdp.c
@@ -3594,8 +3594,8 @@ dissect_sdp_service_attribute(proto_tree *tree, tvbuff_t *tvb, gint offset,
const gchar *attribute_name;
wmem_strbuf_t *attribute_value = NULL;
guint16 id;
- gint service_did_vendor_id = 0;
- gint service_did_vendor_id_source = 0;
+ gint service_did_vendor_id = -1;
+ gint service_did_vendor_id_source = -1;
gint hfx_attribute_id = hf_service_attribute_id_generic;
const value_string *name_vals = NULL;
const guint8 *profile_speficic = "";
@@ -3612,8 +3612,10 @@ dissect_sdp_service_attribute(proto_tree *tree, tvbuff_t *tvb, gint offset,
hfx_attribute_id = hf_service_attribute_id_did;
profile_speficic = "(DID) ";
- service_did_vendor_id_source = findDidVendorIdSource(tvb, service_offset, number_of_attributes);
- service_did_vendor_id = findDidVendorId(tvb, service_offset, number_of_attributes);
+ if (number_of_attributes > 1) {
+ service_did_vendor_id_source = findDidVendorIdSource(tvb, service_offset, number_of_attributes);
+ service_did_vendor_id = findDidVendorId(tvb, service_offset, number_of_attributes);
+ }
break;
case BTSDP_HID_SERVICE_UUID:
name_vals = vs_hid_attribute_id;