diff options
author | nijtmans <nijtmans> | 2010-11-24 15:11:36 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-11-24 15:11:36 (GMT) |
commit | 4fc2d36d6aca8be56fd13423bf984a8e595eee55 (patch) | |
tree | b6cc0de7a53a58703e812ff7bdb1882714fb7716 | |
parent | 83c15249bd48a02b36c03f51e8e07d640a634145 (diff) | |
download | tk-4fc2d36d6aca8be56fd13423bf984a8e595eee55.zip tk-4fc2d36d6aca8be56fd13423bf984a8e595eee55.tar.gz tk-4fc2d36d6aca8be56fd13423bf984a8e595eee55.tar.bz2 |
[Bug #3071836]: Crash/Tcl_Panic on WinXP saving file to C:\
-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; |