aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--asn1/disp/packet-disp-template.c14
-rw-r--r--asn1/dop/packet-dop-template.c16
-rw-r--r--asn1/dsp/packet-dsp-template.c16
-rw-r--r--asn1/p1/packet-p1-template.c16
-rw-r--r--asn1/ros/packet-ros-template.c15
-rw-r--r--asn1/rtse/packet-rtse-template.c16
-rw-r--r--epan/dissectors/packet-disp.c20
-rw-r--r--epan/dissectors/packet-dop.c22
-rw-r--r--epan/dissectors/packet-dsp.c22
-rw-r--r--epan/dissectors/packet-hci_usb.c9
-rw-r--r--epan/dissectors/packet-p1.c22
-rw-r--r--epan/dissectors/packet-pw-atm.c16
-rw-r--r--epan/dissectors/packet-rfid-pn532-hci.c9
-rw-r--r--epan/dissectors/packet-rfid-pn532.c9
-rw-r--r--epan/dissectors/packet-ros.c19
-rw-r--r--epan/dissectors/packet-rtse.c20
-rw-r--r--epan/dissectors/packet-usb-ccid.c7
17 files changed, 109 insertions, 159 deletions
diff --git a/asn1/disp/packet-disp-template.c b/asn1/disp/packet-disp-template.c
index 9245d3c938..0924ee9657 100644
--- a/asn1/disp/packet-disp-template.c
+++ b/asn1/disp/packet-disp-template.c
@@ -87,18 +87,12 @@ dissect_disp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
const char *disp_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.");
- }
+ /* 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);
asn1_ctx.private_data = session;
diff --git a/asn1/dop/packet-dop-template.c b/asn1/dop/packet-dop-template.c
index 0276702d10..3ce204710b 100644
--- a/asn1/dop/packet-dop-template.c
+++ b/asn1/dop/packet-dop-template.c
@@ -129,18 +129,12 @@ dissect_dop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
const char *dop_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_dop, tvb, 0, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_dop);
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);
diff --git a/asn1/p1/packet-p1-template.c b/asn1/p1/packet-p1-template.c
index bd73ccdabb..10ca12e484 100644
--- a/asn1/p1/packet-p1-template.c
+++ b/asn1/p1/packet-p1-template.c
@@ -235,19 +235,13 @@ dissect_p1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* dat
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
- /* save parent_tree so subdissectors can create new top nodes */
- p1_initialize_content_globals (&asn1_ctx, parent_tree, TRUE);
-
- /* 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.");
- }
+ /* 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 );
+ /* save parent_tree so subdissectors can create new top nodes */
+ p1_initialize_content_globals (&asn1_ctx, parent_tree, TRUE);
asn1_ctx.private_data = session;
diff --git a/asn1/ros/packet-ros-template.c b/asn1/ros/packet-ros-template.c
index 35dfad34da..967916d541 100644
--- a/asn1/ros/packet-ros-template.c
+++ b/asn1/ros/packet-ros-template.c
@@ -384,19 +384,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);
/*
diff --git a/asn1/rtse/packet-rtse-template.c b/asn1/rtse/packet-rtse-template.c
index 83386f5d6e..27c26b854b 100644
--- a/asn1/rtse/packet-rtse-template.c
+++ b/asn1/rtse/packet-rtse-template.c
@@ -207,19 +207,13 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
- /* 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 == NULL ){
- if(parent_tree){
- proto_tree_add_text(parent_tree, tvb, offset, -1,
- "Internal error:can't get application context from ACSE dissector.");
- }
+ /* do we have application context from the acse dissector? */
+ if (data == NULL)
return 0;
- }
+ session = (struct SESSION_DATA_STRUCTURE*)data;
- session = ( (struct SESSION_DATA_STRUCTURE*)data);
+ /* save parent_tree so subdissectors can create new top nodes */
+ top_tree=parent_tree;
asn1_ctx.private_data = session;
diff --git a/epan/dissectors/packet-disp.c b/epan/dissectors/packet-disp.c
index 378fc29223..517cb5adc6 100644
--- a/epan/dissectors/packet-disp.c
+++ b/epan/dissectors/packet-disp.c
@@ -1514,18 +1514,12 @@ dissect_disp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
const char *disp_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.");
- }
+ /* 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);
asn1_ctx.private_data = session;
@@ -2061,7 +2055,7 @@ void proto_register_disp(void) {
"ShadowErrorData", HFILL }},
/*--- End of included file: packet-disp-hfarr.c ---*/
-#line 205 "../../asn1/disp/packet-disp-template.c"
+#line 199 "../../asn1/disp/packet-disp-template.c"
};
/* List of subtrees */
@@ -2126,7 +2120,7 @@ void proto_register_disp(void) {
&ett_disp_T_signedShadowError,
/*--- End of included file: packet-disp-ettarr.c ---*/
-#line 211 "../../asn1/disp/packet-disp-template.c"
+#line 205 "../../asn1/disp/packet-disp-template.c"
};
module_t *disp_module;
@@ -2165,7 +2159,7 @@ void proto_reg_handoff_disp(void) {
/*--- End of included file: packet-disp-dis-tab.c ---*/
-#line 239 "../../asn1/disp/packet-disp-template.c"
+#line 233 "../../asn1/disp/packet-disp-template.c"
/* APPLICATION CONTEXT */
diff --git a/epan/dissectors/packet-dop.c b/epan/dissectors/packet-dop.c
index ee56b73368..1731ff5e99 100644
--- a/epan/dissectors/packet-dop.c
+++ b/epan/dissectors/packet-dop.c
@@ -2091,18 +2091,12 @@ dissect_dop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
const char *dop_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_dop, tvb, 0, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_dop);
@@ -2971,7 +2965,7 @@ void proto_register_dop(void) {
NULL, HFILL }},
/*--- End of included file: packet-dop-hfarr.c ---*/
-#line 248 "../../asn1/dop/packet-dop-template.c"
+#line 242 "../../asn1/dop/packet-dop-template.c"
};
/* List of subtrees */
@@ -3050,7 +3044,7 @@ void proto_register_dop(void) {
&ett_dop_GrantsAndDenials,
/*--- End of included file: packet-dop-ettarr.c ---*/
-#line 255 "../../asn1/dop/packet-dop-template.c"
+#line 249 "../../asn1/dop/packet-dop-template.c"
};
static ei_register_info ei[] = {
@@ -3113,7 +3107,7 @@ void proto_reg_handoff_dop(void) {
/*--- End of included file: packet-dop-dis-tab.c ---*/
-#line 295 "../../asn1/dop/packet-dop-template.c"
+#line 289 "../../asn1/dop/packet-dop-template.c"
/* APPLICATION CONTEXT */
oid_add_from_string("id-ac-directory-operational-binding-management","2.5.3.3");
diff --git a/epan/dissectors/packet-dsp.c b/epan/dissectors/packet-dsp.c
index 6a6cd16996..9c8d52429b 100644
--- a/epan/dissectors/packet-dsp.c
+++ b/epan/dissectors/packet-dsp.c
@@ -1803,18 +1803,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);
@@ -2548,7 +2542,7 @@ void proto_register_dsp(void) {
"EXTERNAL", HFILL }},
/*--- End of included file: packet-dsp-hfarr.c ---*/
-#line 277 "../../asn1/dsp/packet-dsp-template.c"
+#line 271 "../../asn1/dsp/packet-dsp-template.c"
};
/* List of subtrees */
@@ -2630,7 +2624,7 @@ void proto_register_dsp(void) {
&ett_dsp_T_basicLevels,
/*--- End of included file: packet-dsp-ettarr.c ---*/
-#line 283 "../../asn1/dsp/packet-dsp-template.c"
+#line 277 "../../asn1/dsp/packet-dsp-template.c"
};
module_t *dsp_module;
@@ -2671,7 +2665,7 @@ void proto_reg_handoff_dsp(void) {
/*--- End of included file: packet-dsp-dis-tab.c ---*/
-#line 313 "../../asn1/dsp/packet-dsp-template.c"
+#line 307 "../../asn1/dsp/packet-dsp-template.c"
/* APPLICATION CONTEXT */
diff --git a/epan/dissectors/packet-hci_usb.c b/epan/dissectors/packet-hci_usb.c
index 6fdf2c08de..37be9330e6 100644
--- a/epan/dissectors/packet-hci_usb.c
+++ b/epan/dissectors/packet-hci_usb.c
@@ -106,13 +106,18 @@ dissect_hci_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree *titem = NULL;
proto_item *pitem = NULL;
gint offset = 0;
- usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data;
+ usb_conv_info_t *usb_conv_info;
tvbuff_t *next_tvb = NULL;
hci_data_t *hci_data;
gint p2p_dir_save;
guint32 session_id;
fragment_head *reassembled;
+ /* Reject the packet if data is NULL */
+ if (data == NULL)
+ return 0;
+ usb_conv_info = (usb_conv_info_t *)data;
+
if (tvb_length_remaining(tvb, offset) <= 0)
return 0;
@@ -121,8 +126,6 @@ dissect_hci_usb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "HCI_USB");
- DISSECTOR_ASSERT(usb_conv_info);
-
p2p_dir_save = pinfo->p2p_dir;
pinfo->p2p_dir = usb_conv_info->direction;
diff --git a/epan/dissectors/packet-p1.c b/epan/dissectors/packet-p1.c
index 58b7d64aab..4881fe39a3 100644
--- a/epan/dissectors/packet-p1.c
+++ b/epan/dissectors/packet-p1.c
@@ -8356,19 +8356,13 @@ dissect_p1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* dat
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
- /* save parent_tree so subdissectors can create new top nodes */
- p1_initialize_content_globals (&asn1_ctx, parent_tree, TRUE);
-
- /* 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.");
- }
+ /* 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 );
+ /* save parent_tree so subdissectors can create new top nodes */
+ p1_initialize_content_globals (&asn1_ctx, parent_tree, TRUE);
asn1_ctx.private_data = session;
@@ -10704,7 +10698,7 @@ void proto_register_p1(void) {
NULL, HFILL }},
/*--- End of included file: packet-p1-hfarr.c ---*/
-#line 326 "../../asn1/p1/packet-p1-template.c"
+#line 320 "../../asn1/p1/packet-p1-template.c"
};
/* List of subtrees */
@@ -10903,7 +10897,7 @@ void proto_register_p1(void) {
&ett_p1_SEQUENCE_SIZE_1_ub_recipients_OF_PerRecipientProbeSubmissionFields,
/*--- End of included file: packet-p1-ettarr.c ---*/
-#line 339 "../../asn1/p1/packet-p1-template.c"
+#line 333 "../../asn1/p1/packet-p1-template.c"
};
static ei_register_info ei[] = {
@@ -11106,7 +11100,7 @@ void proto_reg_handoff_p1(void) {
/*--- End of included file: packet-p1-dis-tab.c ---*/
-#line 385 "../../asn1/p1/packet-p1-template.c"
+#line 379 "../../asn1/p1/packet-p1-template.c"
/* APPLICATION CONTEXT */
diff --git a/epan/dissectors/packet-pw-atm.c b/epan/dissectors/packet-pw-atm.c
index 605559613b..89329f06ac 100644
--- a/epan/dissectors/packet-pw-atm.c
+++ b/epan/dissectors/packet-pw-atm.c
@@ -1145,8 +1145,12 @@ proto_item_append_text_cwb3_fields(proto_item * item, const pwatm_private_data_t
static int
dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data)
{
- pwatm_private_data_t* pd = (pwatm_private_data_t *)data;
- DISSECTOR_ASSERT(pd != NULL);
+ pwatm_private_data_t* pd;
+
+ /* Reject the packet if data is NULL */
+ if (data == NULL)
+ return 0;
+ pd = (pwatm_private_data_t *)data;
/*
* NB: do not touch columns -- keep info from previous dissector
@@ -1334,11 +1338,15 @@ dissect_control_word(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, voi
static int
dissect_cell_header(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * data)
{
- pwatm_private_data_t * pd = (pwatm_private_data_t *)data;
+ pwatm_private_data_t * pd;
gboolean is_enough_data;
int dissect_size;
- DISSECTOR_ASSERT (NULL != pd);
+ /* Reject the packet if data is NULL */
+ if (data == NULL)
+ return 0;
+ pd = (pwatm_private_data_t *)data;
+
pd->vpi = pd->vci = pd->pti = -1;
pd->cwb3.clp = pd->cwb3.m = pd->cwb3.v = pd->cwb3.rsv = pd->cwb3.u = pd->cwb3.e = -1;
diff --git a/epan/dissectors/packet-rfid-pn532-hci.c b/epan/dissectors/packet-rfid-pn532-hci.c
index d0ebef57c1..a5b8a50010 100644
--- a/epan/dissectors/packet-rfid-pn532-hci.c
+++ b/epan/dissectors/packet-rfid-pn532-hci.c
@@ -1,5 +1,5 @@
/* packet-pn532_hci.c
- * Routines for NXP PN532 HCI Protocol
+ * Routines for NXP PN532 HCI Protocol
*
* http://www.nxp.com/documents/user_manual/141520.pdf
*
@@ -76,9 +76,12 @@ dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
guint16 packet_code;
guint16 length;
guint8 checksum;
- usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data;
+ usb_conv_info_t *usb_conv_info;
- DISSECTOR_ASSERT(usb_conv_info);
+ /* Reject the packet if data is NULL */
+ if (data == NULL)
+ return 0;
+ usb_conv_info = (usb_conv_info_t *)data;
length = tvb_length_remaining(tvb, offset);
if (length < 6) return offset;
diff --git a/epan/dissectors/packet-rfid-pn532.c b/epan/dissectors/packet-rfid-pn532.c
index 86c80d4bb0..83edbe701a 100644
--- a/epan/dissectors/packet-rfid-pn532.c
+++ b/epan/dissectors/packet-rfid-pn532.c
@@ -633,7 +633,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
tvbuff_t *next_tvb;
gint offset = 0;
command_data_t *command_data = NULL;
- usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data;
+ usb_conv_info_t *usb_conv_info;
wmem_tree_key_t key[5];
guint32 bus_id;
guint32 device_address;
@@ -643,6 +643,11 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
guint32 k_endpoint;
guint32 k_frame_number;
+ /* Reject the packet if data is NULL */
+ if (data == NULL)
+ return 0;
+ usb_conv_info = (usb_conv_info_t *)data;
+
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PN532");
item = proto_tree_add_item(tree, proto_pn532, tvb, 0, -1, ENC_NA);
@@ -657,8 +662,6 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
col_set_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(cmd, &pn532_commands_ext, "Unknown command"));
- DISSECTOR_ASSERT(usb_conv_info);
-
bus_id = usb_conv_info->bus_id;
device_address = usb_conv_info->device_address;
endpoint = usb_conv_info->endpoint;
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[] = {
diff --git a/epan/dissectors/packet-rtse.c b/epan/dissectors/packet-rtse.c
index 7e2607b816..2dd38cd793 100644
--- a/epan/dissectors/packet-rtse.c
+++ b/epan/dissectors/packet-rtse.c
@@ -763,19 +763,13 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
- /* 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 == NULL ){
- if(parent_tree){
- proto_tree_add_text(parent_tree, tvb, offset, -1,
- "Internal error:can't get application context from ACSE dissector.");
- }
+ /* do we have application context from the acse dissector? */
+ if (data == NULL)
return 0;
- }
+ session = (struct SESSION_DATA_STRUCTURE*)data;
- session = ( (struct SESSION_DATA_STRUCTURE*)data);
+ /* save parent_tree so subdissectors can create new top nodes */
+ top_tree=parent_tree;
asn1_ctx.private_data = session;
@@ -1010,7 +1004,7 @@ void proto_register_rtse(void) {
NULL, HFILL }},
/*--- End of included file: packet-rtse-hfarr.c ---*/
-#line 357 "../../asn1/rtse/packet-rtse-template.c"
+#line 351 "../../asn1/rtse/packet-rtse-template.c"
};
/* List of subtrees */
@@ -1032,7 +1026,7 @@ void proto_register_rtse(void) {
&ett_rtse_CallingSSuserReference,
/*--- End of included file: packet-rtse-ettarr.c ---*/
-#line 366 "../../asn1/rtse/packet-rtse-template.c"
+#line 360 "../../asn1/rtse/packet-rtse-template.c"
};
static ei_register_info ei[] = {
diff --git a/epan/dissectors/packet-usb-ccid.c b/epan/dissectors/packet-usb-ccid.c
index ce46a504ce..9431085afe 100644
--- a/epan/dissectors/packet-usb-ccid.c
+++ b/epan/dissectors/packet-usb-ccid.c
@@ -350,9 +350,12 @@ dissect_ccid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree *ccid_tree;
guint8 cmd;
tvbuff_t *next_tvb;
- usb_conv_info_t *usb_conv_info = (usb_conv_info_t *)data;
+ usb_conv_info_t *usb_conv_info;
- DISSECTOR_ASSERT(usb_conv_info);
+ /* Reject the packet if data is NULL */
+ if (data == NULL)
+ return 0;
+ usb_conv_info = (usb_conv_info_t *)data;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "USBCCID");
col_set_str(pinfo->cinfo, COL_INFO, "CCID Packet");