From de7d3bba104ed74ef20b4fc94f16fc0e21d61abf Mon Sep 17 00:00:00 2001 From: davygrvy Date: Sat, 13 Dec 2003 01:07:35 +0000 Subject: (TkWinEmbeddedEventProc) : for loop dereferences containerPtr but can't get to the if (containerPtr == NULL) test due to the unhandled read memory exception for when it really is NULL. --- win/tkWinEmbed.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index 990ff29..19d4506 100644 --- a/win/tkWinEmbed.c +++ b/win/tkWinEmbed.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: tkWinEmbed.c,v 1.7 2002/08/05 04:30:41 dgp Exp $ + * RCS: @(#) $Id: tkWinEmbed.c,v 1.8 2003/12/13 01:07:35 davygrvy Exp $ */ #include "tkWinInt.h" @@ -385,11 +385,13 @@ TkWinEmbeddedEventProc(hwnd, message, wParam, lParam) */ for (containerPtr = tsdPtr->firstContainerPtr; - containerPtr->parentHWnd != hwnd; + containerPtr && containerPtr->parentHWnd != hwnd; containerPtr = containerPtr->nextPtr) { - if (containerPtr == NULL) { - panic("TkWinContainerProc couldn't find Container record"); - } + /* empty loop body */ + } + + if (containerPtr == NULL) { + Tcl_Panic("TkWinContainerProc couldn't find Container record"); } switch (message) { -- cgit v0.12