summaryrefslogtreecommitdiff
path: root/gtk/gtkentrycompletion.c
diff options
context:
space:
mode:
authorMatthias Clasen <maclas@gmx.de>2004-02-22 01:07:39 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-02-22 01:07:39 +0000
commit8d4f4d5fdeec1b6d68d01d6d6bc4c4c3576b3e97 (patch)
tree9ed8148420bbc1ceda15a807b490213d5b0ea4bd /gtk/gtkentrycompletion.c
parent74fd4c9581f7f38c27cf5c2e37066cdfc67316f1 (diff)
downloadgtk+-8d4f4d5fdeec1b6d68d01d6d6bc4c4c3576b3e97.tar.gz
Don't crash if item is NULL. (#131542, Dan Damian)
Sun Feb 22 02:10:34 2004 Matthias Clasen <maclas@gmx.de> * gtk/gtkentrycompletion.c (gtk_entry_completion_default_completion_func): Don't crash if item is NULL. (#131542, Dan Damian)
Diffstat (limited to 'gtk/gtkentrycompletion.c')
-rw-r--r--gtk/gtkentrycompletion.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index da969f8f07..a4bf298111 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -507,15 +507,18 @@ gtk_entry_completion_default_completion_func (GtkEntryCompletion *completion,
completion->priv->text_column, &item,
-1);
- normalized_string = g_utf8_normalize (item, -1, G_NORMALIZE_ALL);
- case_normalized_string = g_utf8_casefold (normalized_string, -1);
-
- if (!strncmp (key, case_normalized_string, strlen (key)))
- ret = TRUE;
-
- g_free (item);
- g_free (normalized_string);
- g_free (case_normalized_string);
+ if (item != NULL)
+ {
+ normalized_string = g_utf8_normalize (item, -1, G_NORMALIZE_ALL);
+ case_normalized_string = g_utf8_casefold (normalized_string, -1);
+
+ if (!strncmp (key, case_normalized_string, strlen (key)))
+ ret = TRUE;
+
+ g_free (item);
+ g_free (normalized_string);
+ g_free (case_normalized_string);
+ }
return ret;
}