Wireshark-commits: [Wireshark-commits] master-1.10 5db43d1: Fix handling of invalid UAT items
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sat, 28 Feb 2015 02:02:09 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=5db43d19c5e1077cdd624b459bc5c863cb955942
Submitter: Michael Mann (mmann78@xxxxxxxxxxxx)
Changed: branch: master-1.10
Repository: wireshark

Commits:

5db43d1 by Peter Wu (peter@xxxxxxxxxxxxx):

    Fix handling of invalid UAT items
    
    If the UAT file failed a field check, then the user_data pointer may be
    empty. As a result uat_save() triggers an invalid write.
    
    (Discovered while working with a dfilter_macros file having duplicate
    names for bug 10957, caught by ASAN.)
    
    The second issue fixed in this patch is that the validity of an item is
    only calculated when a new record is added. So even if the user edits
    the UAT and makes the entry valid, it would not be saved. This is solved
    by adding a new uat_update_record() function which got wires up into GTK
    and Qt.
    
    Some open-coded g_array_index and UAT[_USER]_INDEX_PTR are also
    converted.
    
    Change-Id: Ia35cfe9d2b793c65144ae7e29a1ed706b6668d99
    Reviewed-on: https://code.wireshark.org/review/7120
    Petri-Dish: Michael Mann <mmann78@xxxxxxxxxxxx>
    Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Michael Mann <mmann78@xxxxxxxxxxxx>
    Reviewed-on: https://code.wireshark.org/review/7149
    

Actions performed:

    from  d24a64a   BSSMAP: VGCS/VBS Assignment Request wrong first parameter
    adds  5db43d1   Fix handling of invalid UAT items


Summary of changes:
 epan/uat-int.h   |    3 +++
 epan/uat.c       |   31 ++++++++++++++++++++++++++-----
 ui/gtk/uat_gui.c |    2 ++
 3 files changed, 31 insertions(+), 5 deletions(-)