From c476140458013d8216208a4ea6f6c8537525fa98 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 26 Jan 2012 16:42:52 +0000 Subject: 3479689 Stop memory corruption when shimmering 0-refCount value to "path" type. --- ChangeLog | 6 ++++++ generic/tclPathObj.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 47c37b0..263cbfa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-01-26 Don Porter + + * generic/tclPathObj.c: [Bug 3475569]: Add checks for unshared values + before calls demanding them. [Bug 3479689]: Stop memory corruption + when shimmering 0-refCount value to "path" type. + 2012-01-22 Jan Nijtmans * tools/uniClass.tcl: [Frq 3473670]: Various Unicode-related 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__) -- cgit v0.12