diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2013-12-09 22:23:44 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2013-12-09 22:23:44 +0000 |
commit | 79fa0d0a3fa8ebb91fac92fda1274957fc55bcd4 (patch) | |
tree | 9a714a0dfd512884ae08640817e2783d528d0bf3 /asn1/dsp | |
parent | e3c369eb6786e8f17e3e8ce6da027012511566b8 (diff) |
Reject the packet if data is NULL without doing anything else.
Note: We *might* want to do _something_ but that _something_ should be well-defined and consistent across all dissectors. Previously, some dissectors called proto_tree_add_text() to add some error message text to the tree, while others called DISSECTOR_ASSERT().
svn path=/trunk/; revision=53895
Diffstat (limited to 'asn1/dsp')
-rw-r--r-- | asn1/dsp/packet-dsp-template.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/asn1/dsp/packet-dsp-template.c b/asn1/dsp/packet-dsp-template.c index fa4f9becd5..3a15d88504 100644 --- a/asn1/dsp/packet-dsp-template.c +++ b/asn1/dsp/packet-dsp-template.c @@ -81,18 +81,12 @@ dissect_dsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da const char *dsp_op_name; asn1_ctx_t asn1_ctx; - asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - - /* do we have operation information from the ROS dissector? */ - if( data == NULL ){ - if(parent_tree){ - proto_tree_add_text(parent_tree, tvb, offset, -1, - "Internal error: can't get operation information from ROS dissector."); - } - return 0; - } + /* do we have operation information from the ROS dissector? */ + if (data == NULL) + return 0; + session = (struct SESSION_DATA_STRUCTURE*)data; - session = ( (struct SESSION_DATA_STRUCTURE*)data); + asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); item = proto_tree_add_item(parent_tree, proto_dsp, tvb, 0, -1, ENC_NA); tree = proto_item_add_subtree(item, ett_dsp); |