aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ros.c
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-09 22:23:44 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2013-12-09 22:23:44 +0000
commit79fa0d0a3fa8ebb91fac92fda1274957fc55bcd4 (patch)
tree9a714a0dfd512884ae08640817e2783d528d0bf3 /epan/dissectors/packet-ros.c
parente3c369eb6786e8f17e3e8ce6da027012511566b8 (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 'epan/dissectors/packet-ros.c')
-rw-r--r--epan/dissectors/packet-ros.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/epan/dissectors/packet-ros.c b/epan/dissectors/packet-ros.c
index 5048da771a..4aeefb72b9 100644
--- a/epan/dissectors/packet-ros.c
+++ b/epan/dissectors/packet-ros.c
@@ -1020,19 +1020,14 @@ dissect_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
+ /* do we have application context from the acse dissector? */
+ if (data == NULL)
+ return 0;
+ asn1_ctx.private_data = data;
+
/* save parent_tree so subdissectors can create new top nodes */
top_tree=parent_tree;
- /* do we have application context from the acse dissector? */
- if( !data){
- if(parent_tree){
- proto_tree_add_text(parent_tree, tvb, offset, -1,
- "Internal error:can't get application context from ACSE dissector.");
- }
- return 0;
- }
-
- asn1_ctx.private_data = data;
conversation = find_or_create_conversation(pinfo);
/*
@@ -1233,7 +1228,7 @@ void proto_register_ros(void) {
"OBJECT_IDENTIFIER", HFILL }},
/*--- End of included file: packet-ros-hfarr.c ---*/
-#line 488 "../../asn1/ros/packet-ros-template.c"
+#line 483 "../../asn1/ros/packet-ros-template.c"
};
/* List of subtrees */
@@ -1254,7 +1249,7 @@ void proto_register_ros(void) {
&ett_ros_Code,
/*--- End of included file: packet-ros-ettarr.c ---*/
-#line 495 "../../asn1/ros/packet-ros-template.c"
+#line 490 "../../asn1/ros/packet-ros-template.c"
};
static ei_register_info ei[] = {