diff options
| author | dgp@users.sourceforge.net <dgp> | 2012-01-26 16:42:52 (GMT) |
|---|---|---|
| committer | dgp@users.sourceforge.net <dgp> | 2012-01-26 16:42:52 (GMT) |
| commit | ae6098d34c0ee72e1cf7842d4322212cd02a1803 (patch) | |
| tree | 3eb0855b1af2fbcd59d9584e772c338eab3977da | |
| parent | e59ec56d67a4ad76950dda310c8665f3fa9d6e62 (diff) | |
| download | tcl-ae6098d34c0ee72e1cf7842d4322212cd02a1803.zip tcl-ae6098d34c0ee72e1cf7842d4322212cd02a1803.tar.gz tcl-ae6098d34c0ee72e1cf7842d4322212cd02a1803.tar.bz2 | |
3479689 Stop memory corruption when shimmering 0-refCount value to "path" type.
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | generic/tclPathObj.c | 3 |
2 files changed, 9 insertions, 0 deletions
@@ -1,3 +1,9 @@ +2012-01-26 Don Porter <dgp@users.sourceforge.net> + + * 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 <nijtmans@users.sf.net> * 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__) |
