aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/wireshark_application.cpp
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-06-22 22:54:30 +0200
committerPeter Wu <peter@lekensteyn.nl>2015-06-22 22:54:19 +0000
commit5ab45709d6137175e1f16651f7474876d6d3e758 (patch)
treee2a7172d60e32204fef8062284c1ac103b39f8c7 /ui/qt/wireshark_application.cpp
parent15045316f5dd8e6d59b2617daa370aff925f3c3a (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/qt/wireshark_application.cpp')
-rw-r--r--ui/qt/wireshark_application.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/qt/wireshark_application.cpp b/ui/qt/wireshark_application.cpp
index 7615297a8e..51627c24eb 100644
--- a/ui/qt/wireshark_application.cpp
+++ b/ui/qt/wireshark_application.cpp
@@ -395,7 +395,7 @@ void WiresharkApplication::setLastOpenDir(const char *dir_name)
qint64 len;
gchar *new_last_open_dir;
- if (dir_name) {
+ if (dir_name && dir_name[0]) {
len = strlen(dir_name);
if (dir_name[len-1] == G_DIR_SEPARATOR) {
new_last_open_dir = g_strconcat(dir_name, (char *)NULL);