aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-usb.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-01-12 20:35:44 -0800
committerGuy Harris <guy@alum.mit.edu>2015-01-13 04:36:24 +0000
commitf90eeb1775b2201fa14d8c8378603325daa89cd2 (patch)
tree95b6d9b2adbc9ea5020a05026f35638a5b27f783 /epan/dissectors/packet-usb.c
parentb204ff4846fe84b7789893c6b1d9afbdecac5b5d (diff)
When allocating address structures, use wmem_new0().
For structures used as the data in an address, use wmem_new(), so that structure padding is zeroed out; the comparison code for addresses compares all bytes of the structure for addresses that are structures, and the hashing code for hash tables using addresses as keys hash all the bytes, so we have to make sure that, for addresses that are the same, *all* bytes are the same. Change-Id: I995fd26cc2f20edb5a599f95562b720561708e57 Reviewed-on: https://code.wireshark.org/review/6517 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-usb.c')
-rw-r--r--epan/dissectors/packet-usb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c
index 9e60b13ef3..275b013ad0 100644
--- a/epan/dissectors/packet-usb.c
+++ b/epan/dissectors/packet-usb.c
@@ -3111,8 +3111,8 @@ usb_set_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, guint16 bus_id
int endpoint, gboolean req)
{
proto_item *sub_item;
- usb_address_t *src_addr = wmem_new(pinfo->pool, usb_address_t),
- *dst_addr = wmem_new(pinfo->pool, usb_address_t);
+ usb_address_t *src_addr = wmem_new0(pinfo->pool, usb_address_t),
+ *dst_addr = wmem_new0(pinfo->pool, usb_address_t);
guint8 *str_src_addr;
guint8 *str_dst_addr;