summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclIOUtil.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 8c030b8..0aeb4cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;