diff options
author | Michael Mann <mmann78@netscape.net> | 2016-05-16 22:17:33 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-05-17 12:29:29 +0000 |
commit | 6614f3809188b19e00570af6b6dd94bca15cd6c5 (patch) | |
tree | d8843e5b86278a132e9e98146255ef9e988617bc /epan/dissectors/packet-arp.c | |
parent | cf66bdb42f7bc76f92807ee2852ce91ae4441115 (diff) |
Replace tvb_get_ptr with tvb_memdup.
The number of bytes allocated is small enough not to matter.
Change-Id: I44c2103a87bd41f21e61d0f27648266fdc2be557
Reviewed-on: https://code.wireshark.org/review/15470
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-arp.c')
-rw-r--r-- | epan/dissectors/packet-arp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-arp.c b/epan/dissectors/packet-arp.c index 242b85db1b..50b2375d48 100644 --- a/epan/dissectors/packet-arp.c +++ b/epan/dissectors/packet-arp.c @@ -1494,7 +1494,7 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) multicast address nor an all-zero address and if sender IP address isn't all zeroes. */ ip = tvb_get_ipv4(tvb, spa_offset); - mac = tvb_get_ptr(tvb, sha_offset, 6); + mac = (const guint8*)tvb_memdup(wmem_packet_scope(), tvb, sha_offset, 6); if ((mac[0] & 0x01) == 0 && memcmp(mac, mac_allzero, 6) != 0 && ip != 0) { if (global_arp_register_network_address_binding) @@ -1518,7 +1518,7 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) ip = tvb_get_ipv4(tvb, tpa_offset); - mac = tvb_get_ptr(tvb, tha_offset, 6); + mac = (const guint8*)tvb_memdup(wmem_packet_scope(), tvb, tha_offset, 6); if ((mac[0] & 0x01) == 0 && memcmp(mac, mac_allzero, 6) != 0 && ip != 0 && ar_op != ARPOP_REQUEST) { |