diff options
author | Peter Wu <peter@lekensteyn.nl> | 2015-06-22 22:54:30 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2015-06-22 22:54:19 +0000 |
commit | 5ab45709d6137175e1f16651f7474876d6d3e758 (patch) | |
tree | e2a7172d60e32204fef8062284c1ac103b39f8c7 /ui/gtk | |
parent | 15045316f5dd8e6d59b2617daa370aff925f3c3a (diff) |
gtk,qt: Fix minor buffer underrun
Avoid accessing the first byte before an empty dirname. No idea why this
was not triggered before. Reproduced with an empty Wireshark profile and
wireshark and wireshark-qt.
Caught with ASAN.
Change-Id: I44f8fdab03ad0f24e663df63a1c54567996a3dfc
Reviewed-on: https://code.wireshark.org/review/9037
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'ui/gtk')
-rw-r--r-- | ui/gtk/file_dlg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/gtk/file_dlg.c b/ui/gtk/file_dlg.c index bb3c2a7752..b7ec47adcb 100644 --- a/ui/gtk/file_dlg.c +++ b/ui/gtk/file_dlg.c @@ -448,7 +448,7 @@ set_last_open_dir(const char *dirname) size_t len; gchar *new_last_open_dir; - if (dirname) { + if (dirname && dirname[0]) { len = strlen(dirname); if (dirname[len-1] == G_DIR_SEPARATOR) { new_last_open_dir = g_strconcat(dirname, NULL); |