Wireshark-commits: [Wireshark-commits] master-2.2 630c237: nettrace_3gpp_32_423: fix memleak and co

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sat, 05 May 2018 09:31:57 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=630c237ac9470b204e8f30bba47766f030aa838e
Submitter: Peter Wu (peter@xxxxxxxxxxxxx)
Changed: branch: master-2.2
Repository: wireshark

Commits:

630c237 by Peter Wu (peter@xxxxxxxxxxxxx):

    nettrace_3gpp_32_423: fix memleak and copy of uninitialized memory
    
    When protocol="map", but the name attribute value is invalid, a memleak
    occurs. Observe also that dissector_table_str is 22 bytes (21 characters
    plus nul) and rounding up to a multiple of 4 means that 2 bytes of
    uninitialized memory could be copied. Avoid that by copying the actual
    length. Memory leak was found by Clang Static Analyzer.
    
    Change-Id: I41f5b104449e108191e505611411a8fb18f1f5db
    Fixes: v2.1.0rc0-2545-g4b4c7a76c3 ("[Nettrace] Add parsing of some HSS records.")
    Reviewed-on: https://code.wireshark.org/review/27350
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    (cherry picked from commit 7c9f333ad0f79d695f530e05cdcceceb7d54d545)
    Reviewed-on: https://code.wireshark.org/review/27366
    Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
    

Actions performed:

    from  d1abbf6   Fix the check for getexecname().
    adds  630c237   nettrace_3gpp_32_423: fix memleak and copy of uninitialized memory


Summary of changes:
 wiretap/nettrace_3gpp_32_423.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)