diff options
author | Michael Tüxen <tuexen@fh-muenster.de> | 2011-06-12 10:35:55 +0000 |
---|---|---|
committer | Michael Tüxen <tuexen@fh-muenster.de> | 2011-06-12 10:35:55 +0000 |
commit | 2119fdb2830797021c5b6ff6edf6d7828b03ffbf (patch) | |
tree | 05b5e8c90192b9793e9fa4aca5bdbd79c99fae8a /gtk | |
parent | 0bd4a1ac3fb8d14d93969a0b84a4728838cb0b89 (diff) |
cfilter can be NULL. Handle this correctly.
This should fix
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6016
svn path=/trunk/; revision=37655
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/cfilter_combo_utils.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gtk/cfilter_combo_utils.c b/gtk/cfilter_combo_utils.c index 4431990ff7..e7fc5ca3ff 100644 --- a/gtk/cfilter_combo_utils.c +++ b/gtk/cfilter_combo_utils.c @@ -71,8 +71,8 @@ void /* write all non empty capture filter strings to the recent file (until max count) */ li = g_list_first(cfilter_list); - while ( li && (max_count++ <= cfilter_combo_max_recent) ) { - if (strlen(li->data)) { + while (li && (max_count++ <= cfilter_combo_max_recent) ) { + if (li->data && strlen(li->data)) { fprintf (rf, RECENT_KEY_CAPTURE_FILTER ": %s\n", (char *)li->data); } li = li->next; @@ -84,10 +84,12 @@ gboolean cfilter_combo_add_recent(gchar *s) { gchar *dup; - dup = g_strdup(s); - if (!cfilter_combo_add(dup)) { - g_free(dup); - return FALSE; + if (s) { + dup = g_strdup(s); + if (!cfilter_combo_add(dup)) { + g_free(dup); + return FALSE; + } } return TRUE; } |