Wireshark-commits: [Wireshark-commits] master-2.6 8201772: nettrace_3gpp_32_423: fix memleak and co
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sat, 05 May 2018 09:30:00 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=8201772c5ef4089e32995defa00fea307072a0b9
Submitter: Peter Wu (peter@xxxxxxxxxxxxx)
Changed: branch: master-2.6
Repository: wireshark

Commits:

8201772 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/27364
    Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
    

Actions performed:

    from  2613d1d   Fix the check for getexecname().
    adds  8201772   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(-)