]> Pileus Git - ~andy/gtk/commitdiff
Don't crash if Xlib fails to return UTF-8. (#159373, Kristian Høgsberg)
authorMatthias Clasen <mclasen@redhat.com>
Fri, 26 Nov 2004 05:43:38 +0000 (05:43 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 26 Nov 2004 05:43:38 +0000 (05:43 +0000)
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)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/x11/gdkselection-x11.c

index 95e70056155d69c0b0e2e84e59234a6d965263b7..af9a19f04117ce15282b332683a352350ff4d451 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * gdk/abicheck.sh
index 95e70056155d69c0b0e2e84e59234a6d965263b7..af9a19f04117ce15282b332683a352350ff4d451 100644 (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>
 
        * gdk/abicheck.sh
index 95e70056155d69c0b0e2e84e59234a6d965263b7..af9a19f04117ce15282b332683a352350ff4d451 100644 (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>
 
        * gdk/abicheck.sh
index 95e70056155d69c0b0e2e84e59234a6d965263b7..af9a19f04117ce15282b332683a352350ff4d451 100644 (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>
 
        * gdk/abicheck.sh
index 13aca15ceaa2f69fdc3f3f7c5ecd5a7aa96cb8d0..06374c5cf6cfb3794913737cb184989e6f75956a 100644 (file)
@@ -643,14 +643,20 @@ gdk_text_property_to_utf8_list_for_display (GdkDisplay    *display,
          else
            {
              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)
        gdk_free_text_list (local_list);
       
-      (*list)[count] = NULL;
+      if (list)
+       (*list)[count] = NULL;
 
       return count;
     }