Wireshark-commits: [Wireshark-commits] master-2.6 370a5d3: wmem: make wmem_strsplit behave more lik
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Tue, 17 Jul 2018 10:09:36 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=370a5d3eb60561f624839251ff41ecde44622bc0
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master-2.6
Repository: wireshark

Commits:

370a5d3 by Peter Wu (peter@xxxxxxxxxxxxx):

    wmem: make wmem_strsplit behave more like g_strsplit
    
    In the past "g_strsplit" users were converted to use "wmem_strsplit" to
    avoid memory leaks when dissection fails. The semantics were slightly
    different though. When the DNS dissector tried to split the string "."
    using delimiter ".", it would previously (unexpectedly) receive an empty
    vector (and crash). Now it will receive a vector with one element.
    
    Additionally, suggest that users of wmem_strsplit with a NULL allocator
    use g_strsplit instead, otherwise it will leak the elements.
    
    Bug: 14980
    Change-Id: I408dfdb0ffa9e24ccdba69c8ee095abea72f6feb
    Reviewed-on: https://code.wireshark.org/review/28724
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    (cherry picked from commit 3d1e3023d2300fe558c6b03066b2b6497f5b02b0)
    Reviewed-on: https://code.wireshark.org/review/28736
    Petri-Dish: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  878e79b   Lua: add include/lua-5.1 and include/lua-5.2 to CMake path suffixes
    adds  370a5d3   wmem: make wmem_strsplit behave more like g_strsplit


Summary of changes:
 epan/wmem/wmem_strutl.c | 79 +++++++++++++++++++------------------------------
 epan/wmem/wmem_strutl.h |  5 +++-
 epan/wmem/wmem_test.c   | 32 +++++++++++++++-----
 3 files changed, 58 insertions(+), 58 deletions(-)