File ghex-empty-search-crash.patch of Package ghex

http://bugzilla.gnome.org/show_bug.cgi?id=473208
================================================================================
--- src/accessiblegtkhex.c
+++ src/accessiblegtkhex.c
@@ -299,11 +299,13 @@
 		format_xblock (gtk_hex, str, 0,gtk_hex->document->file_size);
 	}
 
-	utf8 = g_locale_to_utf8 (str, -1, NULL, NULL, NULL);
-	gail_text_util_text_setup (access_gtk_hex->textutil, utf8);
+	if (str) {
+	    utf8 = g_locale_to_utf8 (str, -1, NULL, NULL, NULL);
+	    gail_text_util_text_setup (access_gtk_hex->textutil, utf8);
 
+	    g_free (utf8);
+	}
 	g_free (str);
-	g_free (utf8);
 
 	return gail_text_util_get_substring (access_gtk_hex->textutil,
 					     start_pos, end_pos);
@@ -494,11 +496,13 @@
 		format_xblock (gtkhex, str, 0, gtkhex->document->file_size);
 	}
 
-	utf8 = g_locale_to_utf8 (str, -1, NULL, NULL, NULL);
-	gail_text_util_text_setup (accessible_gtk_hex->textutil, str);
+	if (str) {
+	    utf8 = g_locale_to_utf8 (str, -1, NULL, NULL, NULL);
+	    gail_text_util_text_setup (accessible_gtk_hex->textutil, str);
 
+	    g_free (utf8); 
+	}
 	g_free (str);
-	g_free (utf8); 
 }
 
 
openSUSE Build Service is sponsored by