diff options
author | ericm <ericm@noemail.net> | 2000-03-07 00:09:07 (GMT) |
---|---|---|
committer | ericm <ericm@noemail.net> | 2000-03-07 00:09:07 (GMT) |
commit | 937776e2a787ffab49008315eeb8cdb6d10d4bc0 (patch) | |
tree | 07a51fc9e31844cac5790d26a696410910bd3886 /generic | |
parent | 3659111c8fbdf0f156a32d938df2ba7284945dde (diff) | |
download | tk-937776e2a787ffab49008315eeb8cdb6d10d4bc0.zip tk-937776e2a787ffab49008315eeb8cdb6d10d4bc0.tar.gz tk-937776e2a787ffab49008315eeb8cdb6d10d4bc0.tar.bz2 |
* generic/tkOldConfig.c: Added check for NULL tkwin value in
Tk_ConfigureWidget [Bug: 4079]
* generic/tkWindow.c: Added check for NULL tkwin value in
Tk_NameToWindow [Bug: 4079]
FossilOrigin-Name: 39ba45d61ca63c0a72d23246b9a94866fe3a6bb6
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkOldConfig.c | 11 | ||||
-rw-r--r-- | generic/tkWindow.c | 11 |
2 files changed, 20 insertions, 2 deletions
diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index 70e0152..9ee2a14 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkOldConfig.c,v 1.5 1999/12/14 06:52:30 hobbs Exp $ + * RCS: @(#) $Id: tkOldConfig.c,v 1.6 2000/03/07 00:09:08 ericm Exp $ */ #include "tkPort.h" @@ -90,6 +90,15 @@ Tk_ConfigureWidget(interp, tkwin, specs, argc, argv, widgRec, flags) int hateFlags; /* If a spec contains any bits here, it's * not considered. */ + if (tkwin == NULL) { + /* + * Either we're not really in Tk, or the main window was destroyed and + * we're on our way out of the application + */ + Tcl_AppendResult(interp, "NULL main window", (char *)NULL); + return TCL_ERROR; + } + needFlags = flags & ~(TK_CONFIG_USER_BIT - 1); if (Tk_Depth(tkwin) <= 1) { hateFlags = TK_CONFIG_COLOR_ONLY; diff --git a/generic/tkWindow.c b/generic/tkWindow.c index bc088f9..04dc7ee 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.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: tkWindow.c,v 1.14 1999/12/16 21:57:36 hobbs Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.15 2000/03/07 00:09:09 ericm Exp $ */ #include "tkPort.h" @@ -2109,6 +2109,15 @@ Tk_NameToWindow(interp, pathName, tkwin) { Tcl_HashEntry *hPtr; + if (tkwin == NULL) { + /* + * Either we're not really in Tk, or the main window was destroyed and + * we're on our way out of the application + */ + Tcl_AppendResult(interp, "NULL main window", (char *)NULL); + return NULL; + } + hPtr = Tcl_FindHashEntry(&((TkWindow *) tkwin)->mainPtr->nameTable, pathName); if (hPtr == NULL) { |