diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2013-12-09 22:38:42 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2013-12-09 22:38:42 +0000 |
commit | babc735c3a59bc947dd17f95601495b8c95fd786 (patch) | |
tree | b89bbda1bee415edbc2225a3f485f1369239237a | |
parent | 79fa0d0a3fa8ebb91fac92fda1274957fc55bcd4 (diff) |
Reject the packet if data is NULL. For now, leave the DISSECTOR_ASSERT(rose_ctx_tmp) since get_rose_ctx() also checks the signature, which might be invalid even if data is not NULL.
svn path=/trunk/; revision=53896
-rw-r--r-- | asn1/q932-ros/packet-q932-ros-template.c | 15 | ||||
-rw-r--r-- | epan/dissectors/packet-q932-ros.c | 9 |
2 files changed, 15 insertions, 9 deletions
diff --git a/asn1/q932-ros/packet-q932-ros-template.c b/asn1/q932-ros/packet-q932-ros-template.c index ffe1d10c12..4e97c9d205 100644 --- a/asn1/q932-ros/packet-q932-ros-template.c +++ b/asn1/q932-ros/packet-q932-ros-template.c @@ -42,17 +42,17 @@ void proto_reg_handoff_q932_ros(void); /* Initialize the protocol and registered fields */ static int proto_q932_ros = -1; -#include "packet-q932-ros-hf.c" +#include "packet-q932-ros-hf.c" /* Initialize the subtree pointers */ -#include "packet-q932-ros-ett.c" +#include "packet-q932-ros-ett.c" static expert_field ei_ros_undecoded = EI_INIT; /* Preferences */ /* Subdissectors */ -static dissector_handle_t data_handle = NULL; +static dissector_handle_t data_handle = NULL; /* Gloabl variables */ static rose_ctx_t *rose_ctx_tmp; @@ -62,10 +62,13 @@ static gchar problem_str[64]; static tvbuff_t *arg_next_tvb, *res_next_tvb, *err_next_tvb; -#include "packet-q932-ros-fn.c" +#include "packet-q932-ros-fn.c" /*--- dissect_q932_ros -----------------------------------------------------*/ static int dissect_q932_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; rose_ctx_tmp = get_rose_ctx(data); DISSECTOR_ASSERT(rose_ctx_tmp); return dissect_ROS_PDU(tvb, pinfo, tree, NULL); @@ -76,12 +79,12 @@ void proto_register_q932_ros(void) { /* List of fields */ static hf_register_info hf[] = { -#include "packet-q932-ros-hfarr.c" +#include "packet-q932-ros-hfarr.c" }; /* List of subtrees */ static gint *ett[] = { -#include "packet-q932-ros-ettarr.c" +#include "packet-q932-ros-ettarr.c" }; static ei_register_info ei[] = { diff --git a/epan/dissectors/packet-q932-ros.c b/epan/dissectors/packet-q932-ros.c index 01ea7bf308..02751e9df8 100644 --- a/epan/dissectors/packet-q932-ros.c +++ b/epan/dissectors/packet-q932-ros.c @@ -104,7 +104,7 @@ static expert_field ei_ros_undecoded = EI_INIT; /* Preferences */ /* Subdissectors */ -static dissector_handle_t data_handle = NULL; +static dissector_handle_t data_handle = NULL; /* Gloabl variables */ static rose_ctx_t *rose_ctx_tmp; @@ -684,6 +684,9 @@ static int dissect_ROS_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree /*--- dissect_q932_ros -----------------------------------------------------*/ static int dissect_q932_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { + /* Reject the packet if data is NULL */ + if (data == NULL) + return 0; rose_ctx_tmp = get_rose_ctx(data); DISSECTOR_ASSERT(rose_ctx_tmp); return dissect_ROS_PDU(tvb, pinfo, tree, NULL); @@ -795,7 +798,7 @@ void proto_register_q932_ros(void) { "InvokeId_present", HFILL }}, /*--- End of included file: packet-q932-ros-hfarr.c ---*/ -#line 80 "../../asn1/q932-ros/packet-q932-ros-template.c" +#line 83 "../../asn1/q932-ros/packet-q932-ros-template.c" }; /* List of subtrees */ @@ -815,7 +818,7 @@ void proto_register_q932_ros(void) { &ett_q932_ros_InvokeId, /*--- End of included file: packet-q932-ros-ettarr.c ---*/ -#line 85 "../../asn1/q932-ros/packet-q932-ros-template.c" +#line 88 "../../asn1/q932-ros/packet-q932-ros-template.c" }; static ei_register_info ei[] = { |