Wireshark-commits: [Wireshark-commits] lts-1.12.1 43c3fe6: gtk: fix crash on Broadway GDK backend
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sun, 11 Jan 2015 19:21:40 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=43c3fe64d4628bfeae638381710f73f687cc8dc8
Submitter: Balint Reczey (balint@xxxxxxxxxxxxxxx)
Changed: branch: lts-1.12.1
Repository: wireshark

Commits:

43c3fe6 by Peter Wu (peter@xxxxxxxxxxxxx):

    gtk: fix crash on Broadway GDK backend
    
    The Broadway GDK backend does never sets event->string. This results in
    a crash when filter_string_te_key_pressed_cb tries to read its contents.
    
    Since the documentation marks reading the string as deprecated, try to
    handle the character conversion here. It is based on
    _gdk_x11_event_translate_keyboard_string (from gtk+), but without trying
    to interpret Escape as '\033', and without trying to convert control
    characters (example: Ctrl + 1). A buffer of 6 bytes is used to hold a
    UTF-8 code point (there is no zero terminator, so 7 bytes as found in
    the original implementation is unnecessary).
    
    As g_locale_from_utf8 returns dynamically allocated memory, change the
    control flow to have a single exit point where pointers are freed as
    needed.
    
    Reproduce with gtk3:
    $ broadwayd :5
    $ GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 wireshark-gtk
    (now open http://localhost:8085/ and start typing in the display filter)
    
    Keys tested: e € (AltGr + 5) ü (AltGr + ", u)
    In the X11 backend, these still get displayed correctly. In the broadway
    backend however, the accents are missing due to a bug in the broadway
    implementation.
    
    Change-Id: Ic1f0ee2b87cd573023ee8e966f06489b3b744dcf
    Reviewed-on: https://code.wireshark.org/review/5832
    Reviewed-by: Balint Reczey <balint@xxxxxxxxxxxxxxx>
    (cherry picked from commit 74b20dca8c255672259d0c43004665d1e9f192dd)
    Reviewed-on: https://code.wireshark.org/review/6494
    Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
    (cherry picked from commit 1d9f3db764bb8cacfb358a0ea84cabb61945182f)
    Reviewed-on: https://code.wireshark.org/review/6495
    

Actions performed:

    from  7f8e46c   WCCP: initialize address table to 0
    adds  43c3fe6   gtk: fix crash on Broadway GDK backend


Summary of changes:
 ui/gtk/filter_autocomplete.c |   60 ++++++++++++++++++++++++------------------
 1 file changed, 34 insertions(+), 26 deletions(-)