Wireshark-commits: [Wireshark-commits] master 5a60c0d: Use wmem_memdup() instead of wmem_alloc() fo
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 31 Dec 2015 21:27:02 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=5a60c0d72e7dfc8c326e854a0d2b739537abb008
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

5a60c0d 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>
    

Actions performed:

    from  31956f9   Don't throw away constness.
    adds  5a60c0d   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(-)