summaryrefslogtreecommitdiffstats
path: root/generic/tclIOUtil.c
diff options
context:
space:
mode:
authorvasiljevic <zv@archiware.com>2006-01-12 18:03:46 (GMT)
committervasiljevic <zv@archiware.com>2006-01-12 18:03:46 (GMT)
commit8fdd6a29a9c9eb192eadf1c481e74db3162cc3d3 (patch)
tree682df7a9d64529627d7f011e1f1d6941b647c8a4 /generic/tclIOUtil.c
parent4190757058d4216a53bcb641a6bf1ebd4cd15b00 (diff)
downloadtcl-8fdd6a29a9c9eb192eadf1c481e74db3162cc3d3.zip
tcl-8fdd6a29a9c9eb192eadf1c481e74db3162cc3d3.tar.gz
tcl-8fdd6a29a9c9eb192eadf1c481e74db3162cc3d3.tar.bz2
Fixed potential overwriting of already freed memory
which caused all kinds of (rare but reproducible) coredumps all over the place.
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r--generic/tclIOUtil.c10
1 files changed, 7 insertions, 3 deletions
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;