From c70489d6ebb4ea3e676beb831935fb3032ad0a39 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 21 Jul 2006 13:42:43 +0000 Subject: [PATCH] =?utf8?q?0-terminate=20outbuf=20in=20all=20cases.=20(#348?= =?utf8?q?227,=20Nguyen=20Th=C3=A1i=20Ngoc=20Duy)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2006-07-21 Matthias Clasen * gtk/gtkimcontextsimple.c (gtk_im_context_simple_get_preedit_string): 0-terminate outbuf in all cases. (#348227, Nguyen Thái Ngoc Duy) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ gtk/gtkimcontextsimple.c | 11 +++-------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 73a790fed..72af19b5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-07-21 Matthias Clasen + + * 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 Enable symbolic colors and color expressions in style diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 73a790fed..72af19b5f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2006-07-21 Matthias Clasen + + * 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 Enable symbolic colors and color expressions in style diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c index 369825760..e6267e514 100644 --- a/gtk/gtkimcontextsimple.c +++ b/gtk/gtkimcontextsimple.c @@ -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); -- 2.43.2