diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | win/tkWinDialog.c | 12 |
2 files changed, 13 insertions, 3 deletions
@@ -1,3 +1,7 @@ +2010-11-24 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tkWinDialog.c: [Bug #3071836]: Crash/Tcl_Panic on WinXP saving file to C:\ + 2010-11-19 Jan Nijtmans <nijtmans@users.sf.net> * win/configure.in: Allow cross-compilation by default. (backported) diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index 6783585..b4853bb 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinDialog.c,v 1.50.2.9 2010/05/19 11:22:59 nijtmans Exp $ + * RCS: @(#) $Id: tkWinDialog.c,v 1.50.2.10 2010/11/24 15:11:36 nijtmans Exp $ * */ @@ -1026,7 +1026,10 @@ OFNHookProcW( dirsize = SendMessageW(hdlg, CDM_GETFOLDERPATH, 0, 0); buffersize = (selsize + dirsize + 1) * 2; - if (selsize > 1) { + /* + * Just empty the buffer if dirsize indicates an error [Bug 3071836] + */ + if ((selsize > 1) && (dirsize > 0)) { if (ofnData->dynFileBufferSize < buffersize) { buffer = (WCHAR *) ckrealloc((char *) buffer, buffersize); ofnData->dynFileBufferSize = buffersize; @@ -1572,7 +1575,10 @@ OFNHookProcA( dirsize = SendMessage(hdlg, CDM_GETFOLDERPATH, 0, 0); buffersize = selsize + dirsize + 1; - if (selsize > 1) { + /* + * Just empty the buffer if dirsize indicates an error [Bug 3071836] + */ + if ((selsize > 1) && (dirsize > 0)) { if (ofnData->dynFileBufferSize < buffersize) { buffer = ckrealloc(buffer, buffersize); ofnData->dynFileBufferSize = buffersize; |