Wireshark-commits: [Wireshark-commits] master-1.12 2c75421: Use wmem_memdup() instead of wmem_alloc
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=2c75421fb842705d322db3657223b897b0ab848b
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master-1.12
Repository: wireshark
Commits:
2c75421 by Guy Harris (guy@xxxxxxxxxxxx):
Use wmem_memdup() instead of wmem_alloc() followed by memcpy().
This also fixes a case where, if nfs_fh->len wasn't a multiple of 4, the
allocated buffer was too short, by the difference between the next lower
multiple of 4 and nfs_fh->len, so the memcpy() went past the end of the
buffer. (And, yes, an NFSv3 file handle can have a byte count that's
not a multiple of 4 - it's a variable-length opaque type - even if the
marshalled data is padded with 0s to a multiple of 4 bytes, as with
other XDR types.)
Change-Id: I689d4b365e8a1547428a1580884f66177dc5841b
Reviewed-on: https://code.wireshark.org/review/12964
Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
(cherry picked from commit 5a60c0d72e7dfc8c326e854a0d2b739537abb008)
Reviewed-on: https://code.wireshark.org/review/12966
Actions performed:
from e5afcea GTP: fix Dual Stack with one static and one Dynamic IP dissection
adds 2c75421 Use wmem_memdup() instead of wmem_alloc() followed by memcpy().
Summary of changes:
epan/dissectors/packet-nfs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)