aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pw-atm.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-pw-atm.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-pw-atm.c')
-rw-r--r--epan/dissectors/packet-pw-atm.c16
1 files changed, 12 insertions, 4 deletions
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;