From a9b4be98e90521e6c741eaf38716b3dc33192e11 Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Thu, 26 Nov 2015 09:23:06 +0100 Subject: SCTP: add another NULL dereference check This is a follow-up of g2259bf8 Change-Id: I4dfb839fcd016a8d7a7210e6358d230025eb96a3 Reviewed-on: https://code.wireshark.org/review/12171 Reviewed-by: Pascal Quantin (cherry picked from commit 1b32d505a59475d51d9b2bed5f0869d2d154e8b6) Reviewed-on: https://code.wireshark.org/review/12172 --- epan/dissectors/packet-sctp.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c index 6c042af189..19900ffc32 100644 --- a/epan/dissectors/packet-sctp.c +++ b/epan/dissectors/packet-sctp.c @@ -3241,12 +3241,14 @@ dissect_fragmented_payload(tvbuff_t *payload_tvb, packet_info *pinfo, proto_tree cur = wmem_list_tail(pinfo->layers); retval = dissect_payload(new_tvb, pinfo, tree, ppi); cur = wmem_list_frame_next(cur); - tmp = wmem_list_frame_data(cur); - proto_id = GPOINTER_TO_UINT(tmp); - proto_name = proto_get_protocol_filter_name(proto_id); - if(strcmp(proto_name, "data") != 0){ - if (have_tap_listener(exported_pdu_tap)){ - export_sctp_data_chunk(pinfo,payload_tvb, proto_name); + if (cur) { + tmp = wmem_list_frame_data(cur); + proto_id = GPOINTER_TO_UINT(tmp); + proto_name = proto_get_protocol_filter_name(proto_id); + if(strcmp(proto_name, "data") != 0){ + if (have_tap_listener(exported_pdu_tap)){ + export_sctp_data_chunk(pinfo,payload_tvb, proto_name); + } } } return retval; -- cgit v1.2.1