summaryrefslogtreecommitdiffstats
path: root/win/tkWinWm.c
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2011-03-10 15:27:35 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2011-03-10 15:27:35 (GMT)
commita3703410046da03d85aa4594af1bc82c8255de48 (patch)
tree032f601ecb5eebc2f61964365a40d563046cfc73 /win/tkWinWm.c
parent63c98ed9b6dfd081afdc878fd8011bfa08eedfa2 (diff)
downloadtk-a3703410046da03d85aa4594af1bc82c8255de48.zip
tk-a3703410046da03d85aa4594af1bc82c8255de48.tar.gz
tk-a3703410046da03d85aa4594af1bc82c8255de48.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/tkWinWm.c')
-rw-r--r--win/tkWinWm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 67c2a6e..290fe3e 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -8635,9 +8635,10 @@ RemapWindows(winPtr, parentHWND)
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) {