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 | |
parent | cf66bdb42f7bc76f92807ee2852ce91ae4441115 (diff) | |
download | wireshark-6614f3809188b19e00570af6b6dd94bca15cd6c5.tar.gz |
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>
-rw-r--r-- | epan/dissectors/packet-arp.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-atm.c | 2 |
2 files changed, 3 insertions, 3 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) { diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c index 2c6569500a..01700bc429 100644 --- a/epan/dissectors/packet-atm.c +++ b/epan/dissectors/packet-atm.c @@ -1524,7 +1524,7 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * FF: parse the Header Error Check (HEC). */ ti = proto_tree_add_item(atm_tree, hf_atm_header_error_check, tvb, 4, 1, ENC_BIG_ENDIAN); - err = get_header_err(tvb_get_ptr(tvb, 0, 5)); + err = get_header_err((const guint8*)tvb_memdup(wmem_packet_scope(), tvb, 0, 5)); if (err == NO_ERROR_DETECTED) proto_item_append_text(ti, " (correct)"); else if (err == UNCORRECTIBLE_ERROR) |