[gtk+/gtk-2-24] Avoid a crash in gtk_im_context_ime_reset



commit 2a24ee075657c39c907332ab6ce62e87f272ccef
Author: Kazuki Iwamoto <iwm maid org>
Date:   Mon Jun 6 19:33:23 2011 -0400

    Avoid a crash in gtk_im_context_ime_reset
    
    When GTK+ runs with inputim-ime.dll module, there is NULL
    pointer reference. Because "context_ime->client_window" may
    be NULL in gtk_im_context_ime_reset.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=644906
    (cherry picked from commit 74f57ee04dfd06d4082443dee20cd8a16428d3d9)

 modules/input/gtkimcontextime.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/modules/input/gtkimcontextime.c b/modules/input/gtkimcontextime.c
index 7fed7c6..1ff6e36 100644
--- a/modules/input/gtkimcontextime.c
+++ b/modules/input/gtkimcontextime.c
@@ -344,6 +344,9 @@ gtk_im_context_ime_reset (GtkIMContext *context)
   HWND hwnd;
   HIMC himc;
 
+  if (!context_ime->client_window)
+    return;
+
   hwnd = GDK_WINDOW_HWND (context_ime->client_window);
   himc = ImmGetContext (hwnd);
   if (!himc)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]