wireshark/ui
Peter Wu 74b20dca8c 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@balintreczey.hu>
2015-01-11 17:45:48 +00:00
..
cli Replace some "low hanging fruit" uses of emem. 2015-01-11 00:27:57 +00:00
gtk gtk: fix crash on Broadway GDK backend 2015-01-11 17:45:48 +00:00
qt Remove ep_ allocated memory from get_conversation_filter and just return a g_alloced string. 2015-01-10 19:58:21 +00:00
win32 Small parenthesis fix 2015-01-08 11:59:11 +00:00
CMakeLists.txt voip_calls: Move to ui. 2014-11-18 00:48:34 +00:00
Makefile.am
Makefile.common voip_calls: Move to ui. 2014-11-18 00:48:34 +00:00
Makefile.nmake Add '*.nativecodeanalysis.xml' to 'clean' targets 2015-01-02 01:45:16 +00:00
alert_box.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
alert_box.h
capture.c Qt: Add a CaptureFile class. 2014-12-20 17:39:29 +00:00
capture.h Qt: Add a CaptureFile class. 2014-12-20 17:39:29 +00:00
capture_globals.h
capture_ui_utils.c
capture_ui_utils.h
console.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
console.h
decode_as_utils.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
decode_as_utils.h
doxygen.cfg.in
export_object.c
export_object.h
export_object_dicom.c
export_object_http.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
export_object_smb.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
export_object_tftp.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
file_dialog.h
filters.c
filters.h
follow.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
follow.h
help_url.c Qt: Initial VoIP Calls dialog. 2014-12-09 21:25:33 +00:00
help_url.h Fix unknown command tag name [-Wdocumentation-unknown-command] 2014-12-22 15:24:28 +00:00
iface_lists.c Replace ep_address_to_str with address_to_str. 2015-01-06 07:38:18 +00:00
iface_lists.h
io_graph_item.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
io_graph_item.h
language.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
language.h
last_open_dir.h
main_statusbar.h
packet_list_utils.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
packet_list_utils.h
persfilepath_opt.c
persfilepath_opt.h
preference_utils.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
preference_utils.h
profile.c Finish off emem_strbuf_t usage. 2015-01-10 04:20:27 +00:00
profile.h
progress_dlg.h
proto_hier_stats.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
proto_hier_stats.h
recent.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
recent.h
recent_utils.h
rtp_analysis.h
rtp_stream.h Consolidate RTP stream structs. 2014-12-20 16:49:05 +00:00
simple_dialog.h
software_update.c
software_update.h
ssl_key_export.c
ssl_key_export.h
tap-megaco-common.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
tap-megaco-common.h
tap-rtp-common.c Replace ep_display_to_address with wmem equivalent display_to_address. 2015-01-05 13:55:04 +00:00
tap-rtp-common.h
tap-sctp-analysis.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
tap-sctp-analysis.h
tap-sequence-analysis.c Replace ep_display_to_address with wmem equivalent display_to_address. 2015-01-05 13:55:04 +00:00
tap-sequence-analysis.h Qt: Initial VoIP Calls dialog. 2014-12-09 21:25:33 +00:00
tap-tcp-stream.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
tap-tcp-stream.h
tap_export_pdu.c Use g_strdup_printf(), rather than a fixed-length buffer, for the app name. 2015-01-03 22:35:27 +00:00
tap_export_pdu.h
text_import.c Handle "I can't map this for that file format" better. 2014-12-18 00:03:26 +00:00
text_import.h
text_import_scanner.h
text_import_scanner.l
time_shift.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
time_shift.h
traffic_table_ui.c Replace ep_display_to_address with wmem equivalent display_to_address. 2015-01-05 13:55:04 +00:00
traffic_table_ui.h
ui_util.h
utf8_entities.h
util.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
util.h
voip_calls.c Remove unneeded includes from ui folder 2015-01-01 23:11:10 +00:00
voip_calls.h Consolidate RTP stream structs. 2014-12-20 16:49:05 +00:00