gtkentrycompletion: check return value because It can be non-UTF8
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=624270
This commit is contained in:
@ -790,15 +790,19 @@ gtk_entry_completion_default_completion_func (GtkEntryCompletion *completion,
|
|||||||
if (item != NULL)
|
if (item != NULL)
|
||||||
{
|
{
|
||||||
normalized_string = g_utf8_normalize (item, -1, G_NORMALIZE_ALL);
|
normalized_string = g_utf8_normalize (item, -1, G_NORMALIZE_ALL);
|
||||||
|
|
||||||
|
if (normalized_string != NULL)
|
||||||
|
{
|
||||||
case_normalized_string = g_utf8_casefold (normalized_string, -1);
|
case_normalized_string = g_utf8_casefold (normalized_string, -1);
|
||||||
|
|
||||||
if (!strncmp (key, case_normalized_string, strlen (key)))
|
if (!strncmp (key, case_normalized_string, strlen (key)))
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
||||||
g_free (item);
|
|
||||||
g_free (normalized_string);
|
|
||||||
g_free (case_normalized_string);
|
g_free (case_normalized_string);
|
||||||
}
|
}
|
||||||
|
g_free (normalized_string);
|
||||||
|
}
|
||||||
|
g_free (item);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user