aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-atn-ulcs.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2013-09-08 21:10:36 +0000
committerPascal Quantin <pascal.quantin@gmail.com>2013-09-08 21:10:36 +0000
commita6ae13dee97af192794a604f348a31b505926d47 (patch)
tree06bcd607342049eda2d55dabf84f5fa72014776b /epan/dissectors/packet-atn-ulcs.c
parent54adc0d2ffe70561ffbe8b38a4bc36e33ef9ae0d (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-ulcs.c')
-rw-r--r--epan/dissectors/packet-atn-ulcs.c128
1 files changed, 65 insertions, 63 deletions
diff --git a/epan/dissectors/packet-atn-ulcs.c b/epan/dissectors/packet-atn-ulcs.c
index 14a000b331..74a2f58e56 100644
--- a/epan/dissectors/packet-atn-ulcs.c
+++ b/epan/dissectors/packet-atn-ulcs.c
@@ -391,71 +391,73 @@ dissect_atn_ulcs_T_pdv_list_presentation_data_values_arbitrary(tvbuff_t *tvb _U_
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);
+ 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;
- 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:
+ 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) */
+ }
return offset;