summaryrefslogtreecommitdiffstats
path: root/generic/tkEvent.c
diff options
context:
space:
mode:
authorgeorgeps <georgeps@noemail.net>2009-01-11 19:05:16 (GMT)
committergeorgeps <georgeps@noemail.net>2009-01-11 19:05:16 (GMT)
commitabf3dc151c985d9a24345ced76c611972035c12c (patch)
treec5a9e0756685eb30be669c950a7c698ded9ced84 /generic/tkEvent.c
parent07e823763356e551c58a27798cbce531c623f7fb (diff)
downloadtk-abf3dc151c985d9a24345ced76c611972035c12c.zip
tk-abf3dc151c985d9a24345ced76c611972035c12c.tar.gz
tk-abf3dc151c985d9a24345ced76c611972035c12c.tar.bz2
* generic/tkEvent.c: Fix a possible segv due to a NULL
pointer dereference that occurs when XCreateIC fails. FossilOrigin-Name: 78d05cc9dd3a6c1d70c80cd4bc8d11b6eda00c16
Diffstat (limited to 'generic/tkEvent.c')
-rw-r--r--generic/tkEvent.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/generic/tkEvent.c b/generic/tkEvent.c
index 13e1304..bcadee5 100644
--- a/generic/tkEvent.c
+++ b/generic/tkEvent.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkEvent.c,v 1.38 2008/12/28 22:59:47 dkf Exp $
+ * RCS: @(#) $Id: tkEvent.c,v 1.39 2009/01/11 19:05:17 georgeps Exp $
*/
#include "tkInt.h"
@@ -353,6 +353,12 @@ CreateXIC(
XFree(preedit_attlist);
}
+
+ if (winPtr->inputContext == NULL) {
+ /* XCreateIC failed. */
+ return;
+ }
+
/*
* Adjust the window's event mask if the IM requires it.
*/