GNOME Bugzilla – Bug 650110
[PATCH] Add sanity check in GtkEntryCompletion
Last modified: 2011-06-01 00:07:48 UTC
Created attachment 187772 [details] [review]
gtk_entry_completion_complete() calls g_utf8_normalize (gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)), -1, G_NORMALIZE_ALL) without checking that completion->priv->entry is a valid GtkEntry, which can lead to passing a NULL pointer to g_utf8_normalize and a segfault. Attached patch adds a check for this.
(This is triggered by the current git version of pcmanfm, which probably has a bug; nevertheless, it would be better to handle the condition gracefully.)
Update: This is not caused by a bug in pcmanfm but by GTK bug #650114.
Adding a return_if_fail does not make it valid to call completion_complete() on an entry-less completion, but it is fine to add anyway.
Review of attachment 187772 [details] [review]: