summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2004-10-20 05:28:38 (GMT)
committerdgp <dgp@users.sourceforge.net>2004-10-20 05:28:38 (GMT)
commit4000672140006e9cc723e096fae6cff45ddcb267 (patch)
tree1d77923cb1f57d180d728d58aaba51b2b1d78c6f
parent21f353c929064a6f5b7ab0395307b808ca9eef3f (diff)
downloadtcl-4000672140006e9cc723e096fae6cff45ddcb267.zip
tcl-4000672140006e9cc723e096fae6cff45ddcb267.tar.gz
tcl-4000672140006e9cc723e096fae6cff45ddcb267.tar.bz2
* generic/tclThreadTest.c (ThreadEventProc): Corrected subtle
bug where the returned (char *) from Tcl_GetStringResult(interp) continued to be used without copying or refcounting, while activity on the interp continued. That's not safe, and recent changes demonstrated the lack of safety with failing tests thread-4.3 and thread-4.5.
-rw-r--r--ChangeLog9
-rw-r--r--generic/tclThreadTest.c4
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 36caf31..9a92cf4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-10-20 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclThreadTest.c (ThreadEventProc): Corrected subtle
+ bug where the returned (char *) from Tcl_GetStringResult(interp)
+ continued to be used without copying or refcounting, while
+ activity on the interp continued. That's not safe, and recent
+ changes demonstrated the lack of safety with failing tests
+ thread-4.3 and thread-4.5.
+
2004-10-19 Donal K. Fellows <donal.k.fellows@man.ac.uk>
* generic/tclDictObj.c (DictWithCmd): Make sure all paths (that
diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c
index c830687..7ea39dc 100644
--- a/generic/tclThreadTest.c
+++ b/generic/tclThreadTest.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclThreadTest.c,v 1.16 2002/01/26 01:10:08 dgp Exp $
+ * RCS: @(#) $Id: tclThreadTest.c,v 1.17 2004/10/20 05:28:39 dgp Exp $
*/
#include "tclInt.h"
@@ -868,13 +868,13 @@ ThreadEventProc(evPtr, mask)
code = Tcl_GlobalEval(interp, threadEventPtr->script);
Tcl_DeleteThreadExitHandler(ThreadFreeProc,
(ClientData) threadEventPtr->script);
- result = Tcl_GetStringResult(interp);
if (code != TCL_OK) {
errorCode = Tcl_GetVar(interp, "errorCode", TCL_GLOBAL_ONLY);
errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
} else {
errorCode = errorInfo = NULL;
}
+ result = Tcl_GetStringResult(interp);
}
ckfree(threadEventPtr->script);
if (resultPtr) {