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>
This commit is contained in:
Michal Labedzki 2014-08-28 08:23:27 +02:00 committed by Michael Mann
parent 051b0000f9
commit 33976181a1
2 changed files with 5 additions and 3 deletions

View File

@ -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);

View File

@ -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;