diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclIOUtil.c | 10 |
2 files changed, 13 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2006-01-12 Zoran Vasiljevic <vasiljevic@users.sourceforge.net> + + * generic/tclIOUtil.c (Tcl_FSGetInternalRep): fixed potential + overwriting of already freed memory which caused all kinds of + (rare but reproducible) coredumps all over the place. + 2006-01-11 Don Porter <dgp@users.sourceforge.net> * tests/error.test (error-7.0): Test the timing of write traces diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 638355c..5e0acbb 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -17,7 +17,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.24 2005/12/15 04:08:26 das Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.25 2006/01/12 18:03:48 vasiljevic Exp $ */ #include "tclInt.h" @@ -5863,12 +5863,16 @@ Tcl_FSGetInternalRep(pathObjPtr, fsPtr) if (srcFsPathPtr->nativePathPtr == NULL) { Tcl_FSCreateInternalRepProc *proc; - proc = srcFsPathPtr->fsRecPtr->fsPtr->createInternalRepProc; + char *nativePathPtr; + proc = srcFsPathPtr->fsRecPtr->fsPtr->createInternalRepProc; if (proc == NULL) { return NULL; } - srcFsPathPtr->nativePathPtr = (*proc)(pathObjPtr); + + nativePathPtr = (*proc)(pathObjPtr); + srcFsPathPtr = (FsPath*) PATHOBJ(pathObjPtr); + srcFsPathPtr->nativePathPtr = nativePathPtr; } return srcFsPathPtr->nativePathPtr; |