Don't crash if Xlib fails to return UTF-8. (#159373, Kristian Høgsberg)

2004-11-26  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkselection-x11.c (gdk_text_property_to_utf8_list_for_display):
	Don't crash if Xlib fails to return UTF-8. (#159373, Kristian Høgsberg)
This commit is contained in:
Matthias Clasen
2004-11-26 05:43:38 +00:00
committed by Matthias Clasen
parent 1d99ca890a
commit 54c6743787
5 changed files with 28 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2004-11-26 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_text_property_to_utf8_list_for_display):
Don't crash if Xlib fails to return UTF-8. (#159373, Kristian Høgsberg)
Thu Nov 25 14:32:35 2004 Manish Singh <yosh@gimp.org> Thu Nov 25 14:32:35 2004 Manish Singh <yosh@gimp.org>
* gdk/abicheck.sh * gdk/abicheck.sh

View File

@ -1,3 +1,8 @@
2004-11-26 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_text_property_to_utf8_list_for_display):
Don't crash if Xlib fails to return UTF-8. (#159373, Kristian Høgsberg)
Thu Nov 25 14:32:35 2004 Manish Singh <yosh@gimp.org> Thu Nov 25 14:32:35 2004 Manish Singh <yosh@gimp.org>
* gdk/abicheck.sh * gdk/abicheck.sh

View File

@ -1,3 +1,8 @@
2004-11-26 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_text_property_to_utf8_list_for_display):
Don't crash if Xlib fails to return UTF-8. (#159373, Kristian Høgsberg)
Thu Nov 25 14:32:35 2004 Manish Singh <yosh@gimp.org> Thu Nov 25 14:32:35 2004 Manish Singh <yosh@gimp.org>
* gdk/abicheck.sh * gdk/abicheck.sh

View File

@ -1,3 +1,8 @@
2004-11-26 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_text_property_to_utf8_list_for_display):
Don't crash if Xlib fails to return UTF-8. (#159373, Kristian Høgsberg)
Thu Nov 25 14:32:35 2004 Manish Singh <yosh@gimp.org> Thu Nov 25 14:32:35 2004 Manish Singh <yosh@gimp.org>
* gdk/abicheck.sh * gdk/abicheck.sh

View File

@ -643,14 +643,20 @@ gdk_text_property_to_utf8_list_for_display (GdkDisplay *display,
else else
{ {
if (list) if (list)
(*list)[count++] = g_strdup (local_list[i]); {
if (g_utf8_validate (local_list[i], -1, NULL))
(*list)[count++] = g_strdup (local_list[i]);
else
g_warning ("Error converting selection");
}
} }
} }
if (local_count) if (local_count)
gdk_free_text_list (local_list); gdk_free_text_list (local_list);
(*list)[count] = NULL; if (list)
(*list)[count] = NULL;
return count; return count;
} }