From c1eabb3837b46d3387543b02626d1877233d77cc Mon Sep 17 00:00:00 2001 From: nijtmans Date: Wed, 24 Nov 2010 08:08:08 +0000 Subject: [Bug #3071836]: Crash/Tcl_Panic on WinXP saving file to C:\ --- ChangeLog | 4 ++++ win/tkWinDialog.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index eebc3b9..ec0e66b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-11-24 Jan Nijtmans + + * win/tkWinDialog.c [Bug #3071836]: Crash/Tcl_Panic on WinXP saving file to C:\ + 2010-11-19 Jan Nijtmans * generic/tkCanv*.c: Revise Tcl_Panic() calls ending with a newline diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index 983bc77..ae89962 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.78 2010/11/03 12:11:44 nijtmans Exp $ + * RCS: @(#) $Id: tkWinDialog.c,v 1.79 2010/11/24 08:08:08 nijtmans Exp $ * */ @@ -1010,7 +1010,10 @@ OFNHookProc( dirsize = SendMessage(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; -- cgit v0.12