summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorpat <pat@noemail.net>2011-03-10 15:27:35 (GMT)
committerpat <pat@noemail.net>2011-03-10 15:27:35 (GMT)
commit7ed2e4350b1ce49de27903044130a420f12ad63d (patch)
tree032f601ecb5eebc2f61964365a40d563046cfc73 /win
parent0fee211d6fd00f8a64d818bc14e70be0c64e3b47 (diff)
downloadtk-7ed2e4350b1ce49de27903044130a420f12ad63d.zip
tk-7ed2e4350b1ce49de27903044130a420f12ad63d.tar.gz
tk-7ed2e4350b1ce49de27903044130a420f12ad63d.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> FossilOrigin-Name: 27afdfb6d53bbf9ba79fd89024a36405cffdf824
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 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) {