]> Pileus Git - ~andy/gtk/commitdiff
Avoid a crash in gtk_im_context_ime_reset
authorKazuki Iwamoto <iwm@maid.org>
Mon, 6 Jun 2011 23:33:23 +0000 (19:33 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 6 Jun 2011 23:33:23 +0000 (19:33 -0400)
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

modules/input/gtkimcontextime.c

index 786fb9d40eeb4b63b6b7e6885541e261a587c8af..16f2e7d495a6698ec9bedb13175beeabd53476fc 100644 (file)
@@ -348,6 +348,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)