diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2013-09-08 21:10:36 +0000 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2013-09-08 21:10:36 +0000 |
commit | a6ae13dee97af192794a604f348a31b505926d47 (patch) | |
tree | 06bcd607342049eda2d55dabf84f5fa72014776b /epan/dissectors/packet-atn-cpdlc.c | |
parent | 54adc0d2ffe70561ffbe8b38a4bc36e33ef9ae0d (diff) |
Slightly different fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9117 :
Check that tvb returned by dissect_per_bit_string is not null before trying to use it
svn path=/trunk/; revision=51846
Diffstat (limited to 'epan/dissectors/packet-atn-cpdlc.c')
-rw-r--r-- | epan/dissectors/packet-atn-cpdlc.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/epan/dissectors/packet-atn-cpdlc.c b/epan/dissectors/packet-atn-cpdlc.c index 400b5c1bd1..718be5ae50 100644 --- a/epan/dissectors/packet-atn-cpdlc.c +++ b/epan/dissectors/packet-atn-cpdlc.c @@ -5123,15 +5123,17 @@ dissect_atn_cpdlc_CPDLCMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index, NO_BOUND, NO_BOUND, FALSE, &tvb_usr); - switch(check_heur_msg_type(actx->pinfo)){ - case dm: - dissect_atn_cpdlc_ATCDownlinkMessage(tvb_new_subset_remaining(tvb_usr, 0), 0, actx, tree, hf_index); - break; - case um: - dissect_atn_cpdlc_ATCUplinkMessage(tvb_new_subset_remaining(tvb_usr, 0), 0, actx , tree, hf_index); - break; - default: - break; + if (tvb_usr) { + switch(check_heur_msg_type(actx->pinfo)){ + case dm: + dissect_atn_cpdlc_ATCDownlinkMessage(tvb_new_subset_remaining(tvb_usr, 0), 0, actx, tree, hf_index); + break; + case um: + dissect_atn_cpdlc_ATCUplinkMessage(tvb_new_subset_remaining(tvb_usr, 0), 0, actx , tree, hf_index); + break; + default: + break; + } } |