summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-01-26 16:42:52 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-01-26 16:42:52 (GMT)
commit2082b1ef56eb015bfbdfd99bd2c7173346d80372 (patch)
tree3eb0855b1af2fbcd59d9584e772c338eab3977da /generic/tclPathObj.c
parent8312da70be77c03f1d366457afbda923902b1877 (diff)
downloadtcl-2082b1ef56eb015bfbdfd99bd2c7173346d80372.zip
tcl-2082b1ef56eb015bfbdfd99bd2c7173346d80372.tar.gz
tcl-2082b1ef56eb015bfbdfd99bd2c7173346d80372.tar.bz2
3479689 Stop memory corruption when shimmering 0-refCount value to "path" type.
Diffstat (limited to 'generic/tclPathObj.c')
-rw-r--r--generic/tclPathObj.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index c32202d..6a26b9f 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -2551,7 +2551,10 @@ SetFsPathFromAny(
}
Tcl_DStringFree(&temp);
} else {
+ /* Bug 3479689: protect 0-refcount pathPth from getting freed */
+ pathPtr->refCount++;
transPtr = Tcl_FSJoinToPath(pathPtr, 0, NULL);
+ pathPtr->refCount--;
}
#if defined(__CYGWIN__) && defined(__WIN32__)