]> Pileus Git - ~andy/gtk/commitdiff
0-terminate outbuf in all cases. (#348227, Nguyen Thái Ngoc Duy)
authorMatthias Clasen <mclasen@redhat.com>
Fri, 21 Jul 2006 13:42:43 +0000 (13:42 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 21 Jul 2006 13:42:43 +0000 (13:42 +0000)
2006-07-21  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkimcontextsimple.c (gtk_im_context_simple_get_preedit_string):
0-terminate outbuf in all cases.  (#348227, Nguyen Thái Ngoc Duy)

ChangeLog
ChangeLog.pre-2-10
gtk/gtkimcontextsimple.c

index 73a790fedf6c9d75dc84ae8a9371b06c4dff400b..72af19b5fd3f1ba1434fd1caa861a717f712c4ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-07-21  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkimcontextsimple.c (gtk_im_context_simple_get_preedit_string): 
+       0-terminate outbuf in all cases.  (#348227, Nguyen Thái Ngoc Duy)
+
 2006-07-21  Michael Natterer  <mitch@imendio.com>
 
        Enable symbolic colors and color expressions in style
index 73a790fedf6c9d75dc84ae8a9371b06c4dff400b..72af19b5fd3f1ba1434fd1caa861a717f712c4ac 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-21  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkimcontextsimple.c (gtk_im_context_simple_get_preedit_string): 
+       0-terminate outbuf in all cases.  (#348227, Nguyen Thái Ngoc Duy)
+
 2006-07-21  Michael Natterer  <mitch@imendio.com>
 
        Enable symbolic colors and color expressions in style
index 3698257601acc1ac70e57cb0a9297669f6164373..e6267e514e0259f5bc4bdb7dec81f7472e463245 100644 (file)
@@ -1540,17 +1540,12 @@ gtk_im_context_simple_get_preedit_string (GtkIMContext   *context,
        }
 
       g_assert (len < 25);
-      outbuf[len] = '\0';      
     }
   else if (context_simple->tentative_match)
-    {
-      len = g_unichar_to_utf8 (context_simple->tentative_match, outbuf);
-    }
-  else
-    {
-      outbuf[0] = '\0';
-    }
+    len = g_unichar_to_utf8 (context_simple->tentative_match, outbuf);
       
+  outbuf[len] = '\0';      
+
   if (str)
     *str = g_strdup (outbuf);