summaryrefslogtreecommitdiffstats
path: root/win/tkWinDialog.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-11-24 08:08:08 (GMT)
committernijtmans <nijtmans>2010-11-24 08:08:08 (GMT)
commitc1eabb3837b46d3387543b02626d1877233d77cc (patch)
treef4355052b029d7e82a489fbba50625115fd116fb /win/tkWinDialog.c
parent92c03979f6743ffce1d4b3ce95309dd43e6aed91 (diff)
downloadtk-c1eabb3837b46d3387543b02626d1877233d77cc.zip
tk-c1eabb3837b46d3387543b02626d1877233d77cc.tar.gz
tk-c1eabb3837b46d3387543b02626d1877233d77cc.tar.bz2
[Bug #3071836]: Crash/Tcl_Panic on WinXP saving file to C:\
Diffstat (limited to 'win/tkWinDialog.c')
-rw-r--r--win/tkWinDialog.c7
1 files changed, 5 insertions, 2 deletions
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;