summaryrefslogtreecommitdiffstats
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)
commitacd54f587bcd813be83e9cd03fdf8b4d4e394d68 (patch)
treec3ca138ca3bba74904582c75461dc716c55a329f
parent752451859dfcfc5dd3dc14b0b4844021d6230775 (diff)
downloadtk-acd54f587bcd813be83e9cd03fdf8b4d4e394d68.zip
tk-acd54f587bcd813be83e9cd03fdf8b4d4e394d68.tar.gz
tk-acd54f587bcd813be83e9cd03fdf8b4d4e394d68.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>
-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) {