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 /asn1/atn-ulcs | |
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 'asn1/atn-ulcs')
-rw-r--r-- | asn1/atn-ulcs/atn-ulcs.cnf | 130 |
1 files changed, 66 insertions, 64 deletions
diff --git a/asn1/atn-ulcs/atn-ulcs.cnf b/asn1/atn-ulcs/atn-ulcs.cnf index a4ece639fe..f7b0b4735d 100644 --- a/asn1/atn-ulcs/atn-ulcs.cnf +++ b/asn1/atn-ulcs/atn-ulcs.cnf @@ -62,71 +62,73 @@ PDV-list/presentation-data-values/arbitrary pdv-list_presentation-data-values_ar FALSE, &tvb_usr); - /* call appropiate dissector for bitstring data */ - switch(ulcs_context_value){ - case 1: /* ACSE PDU*/ - ti = proto_tree_add_text( - root_tree, - tvb, - offset, - 0, - ATN_ACSE_PROTO ); - atn_ulcs_tree = proto_item_add_subtree(ti, ett_atn_acse); - - dissect_ACSE_apdu_PDU( - tvb_new_subset_remaining(tvb_usr, 0), - pinfo, - atn_ulcs_tree); - break; - case 3: /* USER data; call subdissector for CM, CPDLC ... */ - - /* using dstref for PDV-list only occurrs in DT */ - atn_cv = find_atn_conversation( - &pinfo->dst, - pinfo->clnp_dstref, - &pinfo->src); - - if(atn_cv) { - switch(atn_cv->ae_qualifier){ - case cma: /* contact management */ - call_dissector_with_data( - atn_cm_handle, - tvb_new_subset_remaining(tvb_usr, 0), - pinfo, - root_tree, - NULL); - break; - case cpdlc: /* plain old cpdlc */ - case pmcpdlc: /* protected mode cpdlc */ - call_dissector_with_data( - atn_cpdlc_handle, - tvb_new_subset_remaining(tvb_usr, 0), - pinfo, - root_tree, - NULL); - break; - default: /* unknown or unhandled datalink application */ - dissector_try_heuristic( - atn_ulcs_heur_subdissector_list, - tvb_new_subset_remaining(tvb_usr,0), - actx->pinfo, - root_tree, - NULL); - break; - } - } - else{ - dissector_try_heuristic( - atn_ulcs_heur_subdissector_list, - tvb_new_subset_remaining(tvb_usr,0), - actx->pinfo, - root_tree, - NULL); - } - break; - default: + if (tvb_usr) { + /* call appropiate dissector for bitstring data */ + switch(ulcs_context_value){ + case 1: /* ACSE PDU*/ + ti = proto_tree_add_text( + root_tree, + tvb, + offset, + 0, + ATN_ACSE_PROTO ); + atn_ulcs_tree = proto_item_add_subtree(ti, ett_atn_acse); + + dissect_ACSE_apdu_PDU( + tvb_new_subset_remaining(tvb_usr, 0), + pinfo, + atn_ulcs_tree); break; - } /* switch(ulcs_context_value) */ + case 3: /* USER data; call subdissector for CM, CPDLC ... */ + + /* using dstref for PDV-list only occurrs in DT */ + atn_cv = find_atn_conversation( + &pinfo->dst, + pinfo->clnp_dstref, + &pinfo->src); + + if(atn_cv) { + switch(atn_cv->ae_qualifier){ + case cma: /* contact management */ + call_dissector_with_data( + atn_cm_handle, + tvb_new_subset_remaining(tvb_usr, 0), + pinfo, + root_tree, + NULL); + break; + case cpdlc: /* plain old cpdlc */ + case pmcpdlc: /* protected mode cpdlc */ + call_dissector_with_data( + atn_cpdlc_handle, + tvb_new_subset_remaining(tvb_usr, 0), + pinfo, + root_tree, + NULL); + break; + default: /* unknown or unhandled datalink application */ + dissector_try_heuristic( + atn_ulcs_heur_subdissector_list, + tvb_new_subset_remaining(tvb_usr,0), + actx->pinfo, + root_tree, + NULL); + break; + } + } + else{ + dissector_try_heuristic( + atn_ulcs_heur_subdissector_list, + tvb_new_subset_remaining(tvb_usr,0), + actx->pinfo, + root_tree, + NULL); + } + break; + default: + break; + } /* switch(ulcs_context_value) */ + } #.END |