From 191e0d652ef5f96562b77df1262200dcf070dd2c Mon Sep 17 00:00:00 2001 From: georgeps Date: Sun, 11 Jan 2009 19:05:17 +0000 Subject: * generic/tkEvent.c: Fix a possible segv due to a NULL pointer dereference that occurs when XCreateIC fails. --- ChangeLog | 5 +++++ generic/tkEvent.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9be8319..483c261 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-11 George Peter Staplin + + * generic/tkEvent.c: Fix a possible segv due to a NULL + pointer dereference that occurs when XCreateIC fails. + 2009-01-11 Pat Thoyts * library/bgerror.tcl: Pretty up the unix tk_messageBox 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. */ -- cgit v0.12