Wireshark-commits: [Wireshark-commits] master acba178: wmem: ensure wmem_memdup(..., NULL, 0) retur
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Mon, 19 Mar 2018 16:15:44 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=acba1785460149b65a890a2b060ed87cf4e41102
Submitter: Evan Huus (eapache@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

acba178 by Peter Wu (peter@xxxxxxxxxxxxx):

    wmem: ensure wmem_memdup(..., NULL, 0) returns NULL
    
    Rather than requiring all callers to pass a non-null source argument,
    explicitly allow a NULL source when the size is zero. This is consistent
    with g_memdup behavior.
    
    While at it, fix a memleak and avoid memset(0,0,0) in tests.
    
    Change-Id: I86a092625a508544d180da959e4afdd0366539f4
    Reviewed-on: https://code.wireshark.org/review/26496
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Reviewed-by: Mališa Vučinić <malishav@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Evan Huus <eapache@xxxxxxxxx>
    

Actions performed:

    from  859c5bf   wmem: fix random test failure due to key collision
    adds  acba178   wmem: ensure wmem_memdup(..., NULL, 0) returns NULL


Summary of changes:
 epan/wmem/wmem_miscutl.c | 3 +++
 epan/wmem/wmem_miscutl.h | 2 +-
 epan/wmem/wmem_test.c    | 7 ++++++-
 3 files changed, 10 insertions(+), 2 deletions(-)