Wireshark-commits: [Wireshark-commits] master 66318ad: Don't assert out on tvb_memcpy() with a null
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 21 Aug 2014 07:40:01 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=66318ad5eb8235e73e66acee372df7c47cfea8bd
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

66318ad by Guy Harris (guy@xxxxxxxxxxxx):

    Don't assert out on tvb_memcpy() with a null data pointer if the length is 0.
    
    If the length is 0, there's nothing to copy, so it doesn't matter if
    there's no data to copy from.  This fixes problems caused by allocating
    a zero-length buffer and using that as the data for a tvbuff; the
    allocation returns null, so the data pointer is null.
    
    Change-Id: I8037ae4b96d30e90a716852bb7e22d3980444f83
    Reviewed-on: https://code.wireshark.org/review/3761
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    

Actions performed:

    from  bed29af   Extcap Capture Interface
    adds  66318ad   Don't assert out on tvb_memcpy() with a null data pointer if the length is 0.


Summary of changes:
 epan/tvbuff.c |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)