GNOME Bugzilla – Bug 624270
crash in gtk_entry_completion_default_completion_func
Last modified: 2011-10-13 13:05:14 UTC
Originally from: https://bugzilla.redhat.com/show_bug.cgi?id=611571
+ Trace 222827
Thread 1 (Thread 11634)
$1 = (const gchar *) 0x39dfb90 "eur (euro)" (gdb) print case_normalized_string $2 = (gchar *) 0x0 (gdb) list 788 if (item != NULL) 789 { 790 normalized_string = g_utf8_normalize (item, -1, G_NORMALIZE_ALL); 791 case_normalized_string = g_utf8_casefold (normalized_string, -1); 792 793 if (!strncmp (key, case_normalized_string, strlen (key))) 794 ret = TRUE; 795 796 g_free (item); 797 g_free (normalized_string); (gdb) print item $3 = (gchar *) 0x36af550 "ANG (Niederl\344ndische Antillen-Gulden)" g_utf8_normalize returns NULL (as the string isn't UTF-8). Should this return value be checked?
Created attachment 166176 [details] [review] check return value
Review of attachment 166176 [details] [review]: ::: gtk/gtkentrycompletion.c @@ +800,3 @@ + { + if (normalized_string != NULL) + g_free (normalized_string) could still go outside the if() block: g_free (NULL) is a no-op. minor style issue. other than that, looks okay to me.
Comment on attachment 166176 [details] [review] check return value committed with your comments commit 910ad4872ca4413d958e4303245611acd3a84d0f
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
*** Bug 628710 has been marked as a duplicate of this bug. ***
This is still an issue in gtk 2.24.6. It seems that the fix didn't found its way to the gtk2 branch.
cherry-picked to gtk2-24 branch: commit fb99ca1979574807f67e30509f7d8750a0b529ff