summaryrefslogtreecommitdiffstats
path: root/generic/tclFCmd.c
diff options
context:
space:
mode:
authorandreask <andreask>2011-04-20 17:51:02 (GMT)
committerandreask <andreask>2011-04-20 17:51:02 (GMT)
commit8556b1aba054954e5f7f386dc1833ca08fdb5e9f (patch)
treec216b78892f1ce080572e61d80bcd43c554bd0b6 /generic/tclFCmd.c
parentca25f33d9cc7e793a0cd7bc0e6a3e805f122cd38 (diff)
downloadtcl-8556b1aba054954e5f7f386dc1833ca08fdb5e9f.zip
tcl-8556b1aba054954e5f7f386dc1833ca08fdb5e9f.tar.gz
tcl-8556b1aba054954e5f7f386dc1833ca08fdb5e9f.tar.bz2
(TclFileAttrsCmd): Added commands to reset the typePtr of the Tcl_Obj* whose int-rep was just purged. Required to prevent a dangling IndexRep* to reused, smashing the heap. See also the entries at 2011-04-16 and 2011-03-24 for the history of the problem.
Note also bug 2857044. This is the original report and fix of such issues for HEAD.
Diffstat (limited to 'generic/tclFCmd.c')
-rw-r--r--generic/tclFCmd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c
index 5850846..2b4977b 100644
--- a/generic/tclFCmd.c
+++ b/generic/tclFCmd.c
@@ -1074,6 +1074,7 @@ TclFileAttrsCmd(
}
if (didAlloc) {
TclFreeIntRep(objv[0]);
+ objv[0]->typePtr = NULL;
}
if (Tcl_FSFileAttrsGet(interp, index, filePtr,
&objPtr) != TCL_OK) {
@@ -1101,6 +1102,7 @@ TclFileAttrsCmd(
}
if (didAlloc) {
TclFreeIntRep(objv[i]);
+ objv[i]->typePtr = NULL;
}
if (i + 1 == objc) {
Tcl_AppendResult(interp, "value for \"",