summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2011-03-10 12:26:38 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2011-03-10 12:26:38 (GMT)
commit352d73cdf518b78ec290bce0f2e3c0930f635133 (patch)
treec3ca138ca3bba74904582c75461dc716c55a329f /win
parente3936d97898ad60cae3136709e8d443c97f4515d (diff)
downloadtk-352d73cdf518b78ec290bce0f2e3c0930f635133.zip
tk-352d73cdf518b78ec290bce0f2e3c0930f635133.tar.gz
tk-352d73cdf518b78ec290bce0f2e3c0930f635133.tar.bz2
[Bug 3205260] avoid crash in wm manage of children with null class
The tkhtml widget doesn't set it's window class. The Windows implementation of the wm manage command checks to see if the contained window is actually a menu (looking for torn-off menus) by examining the class. This patch adds a check for a null class to avoid crashing as suggested. Suggested-by: Eric Boudaillier <beric@users.sourceforge.net> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Diffstat (limited to 'win')
-rw-r--r--win/tkWinWm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 94c8bb8..6b151cb 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -8545,12 +8545,13 @@ RemapWindows(
HWND parentHWND)
{
TkWindow *childPtr;
+ const char *className = Tk_Class(winPtr);
/*
* Skip menus as they are handled differently.
*/
- if (strcmp(Tk_Class(winPtr), "Menu") == 0) {
+ if (className != NULL && strcmp(className, "Menu") == 0) {
return;
}
if (winPtr->window) {