summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2014-08-28 08:23:27 +0200
committerMichael Mann <mmann78@netscape.net>2014-09-18 16:15:38 +0000
commit33976181a153a931a615d1c2331c26d2e0558076 (patch)
treeb8d490adea69737a61b339e915ddb6e6e0f91bf2
parent051b0000f9a6295284eed9330c05fec156c0d549 (diff)
downloadwireshark-33976181a153a931a615d1c2331c26d2e0558076.tar.gz
Bluetooth: Fix some Clang Analyzer warnings
Logic error Dereference of null pointer epan/dissectors/packet-bthci_acl.c 379 Logic error Dereference of null pointer epan/dissectors/packet-bthci_acl.c 390 Logic error Dereference of null pointer epan/dissectors/packet-btsdp.c 3673 Logic error Dereference of null pointer epan/dissectors/packet-btsdp.c 1439 Logic error Dereference of null pointer epan/dissectors/packet-btsdp.c 1662 Thanks for Alexis La Goutte for pointing that. Change-Id: Ia646b33de9e368d32983efddfaa41edf7896d7fd Reviewed-on: https://code.wireshark.org/review/4165 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-bthci_acl.c2
-rw-r--r--epan/dissectors/packet-btsdp.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/epan/dissectors/packet-bthci_acl.c b/epan/dissectors/packet-bthci_acl.c
index 09f927849d..6ee0db654b 100644
--- a/epan/dissectors/packet-bthci_acl.c
+++ b/epan/dissectors/packet-bthci_acl.c
@@ -330,6 +330,8 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
chandle_data->start_fragments = wmem_tree_new(wmem_file_scope());
wmem_tree_insert32_array(chandle_tree, key, chandle_data);
+ } else if (pinfo->fd->flags.visited && !chandle_data) {
+ DISSECTOR_ASSERT_HINT(0, "Impossible: no previously session saved");
}
length = tvb_get_letohs(tvb, offset);
diff --git a/epan/dissectors/packet-btsdp.c b/epan/dissectors/packet-btsdp.c
index 07376eb2f6..b045c3e13f 100644
--- a/epan/dissectors/packet-btsdp.c
+++ b/epan/dissectors/packet-btsdp.c
@@ -1436,7 +1436,7 @@ reassemble_continuation_state(tvbuff_t *tvb, packet_info *pinfo,
tid_request->data_length, tid_request->data_length);
if (new_tvb) *new_tvb = next_tvb;
- if (tid_request->continuation_state_length) *is_first = FALSE;
+ if (tid_request->continuation_state_length && is_first) *is_first = FALSE;
if (uuid_array) *uuid_array = tid_request->uuid_array;
if (record_handle) *record_handle = tid_request->record_handle;
@@ -1659,7 +1659,7 @@ reassemble_continuation_state(tvbuff_t *tvb, packet_info *pinfo,
tid_request->data_length, tid_request->data_length);
if (new_tvb) *new_tvb = next_tvb;
- if (tid_request->continuation_state_length) *is_first = FALSE;
+ if (tid_request->continuation_state_length && is_first) *is_first = FALSE;
if (uuid_array) *uuid_array = tid_request->uuid_array;
if (record_handle) *record_handle = tid_request->record_handle;
@@ -3666,7 +3666,7 @@ dissect_sdp_service_attribute_list(proto_tree *tree, tvbuff_t *tvb, gint offset,
uuid, service_offset, service_info, number_of_attributes, FALSE);
}
- if (!pinfo->fd->flags.visited) {
+ if (!pinfo->fd->flags.visited && service_info) {
k_interface_id = l2cap_data->interface_id;
k_adapter_id = l2cap_data->adapter_id;
k_sdp_psm = l2cap_data->psm;