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 /epan/dissectors/packet-rfid-pn532-hci.c | |
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 'epan/dissectors/packet-rfid-pn532-hci.c')
-rw-r--r-- | epan/dissectors/packet-rfid-pn532-hci.c | 9 |
1 files changed, 6 insertions, 3 deletions
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; |