diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2014-12-26 19:52:38 +0100 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2014-12-26 18:58:07 +0000 |
commit | a442a1c0e815fd61416cf408bd74d85a042ccc6a (patch) | |
tree | ac6c07a23d461a95666a016d659d00b3d1738293 | |
parent | f2224bc578169548de0c25094f77b43d8f55d436 (diff) |
WCCP: initialize address table to 0
It prevents an uninitialized access later on if an exception is triggered before filling the table
Bug: 10806
Change-Id: I8f75fb18cd8d033013c34093f9d6c8762f23452b
Reviewed-on: https://code.wireshark.org/review/6056
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r-- | epan/dissectors/packet-wccp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-wccp.c b/epan/dissectors/packet-wccp.c index 268554e8e3..6b19bd42bf 100644 --- a/epan/dissectors/packet-wccp.c +++ b/epan/dissectors/packet-wccp.c @@ -1891,7 +1891,7 @@ dissect_wccp2r1_address_table_info(tvbuff_t *tvb, int offset, case 1: if (wccp_wccp_address_table.table_ipv4 == NULL) wccp_wccp_address_table.table_ipv4 = (guint32 *) - wmem_alloc(pinfo->pool, wccp_wccp_address_table.table_length * 4); + wmem_alloc0(pinfo->pool, wccp_wccp_address_table.table_length * 4); if (address_length != 4) { expert_add_info_format(pinfo, tf, &ei_wccp_length_bad, "The Address length must be 4, but I found %d for IPv4 addresses. Correcting this.", @@ -1902,7 +1902,7 @@ dissect_wccp2r1_address_table_info(tvbuff_t *tvb, int offset, case 2: if (wccp_wccp_address_table.table_ipv6 == NULL) wccp_wccp_address_table.table_ipv6 = (struct e_in6_addr *) - wmem_alloc(pinfo->pool, wccp_wccp_address_table.table_length * sizeof(struct e_in6_addr)); + wmem_alloc0(pinfo->pool, wccp_wccp_address_table.table_length * sizeof(struct e_in6_addr)); if (address_length != 16) { expert_add_info_format(pinfo, tf, &ei_wccp_length_bad, "The Address length must be 16, but I found %d for IPv6 addresses. Correcting this", |