summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--generic/tclFileName.c4
-rw-r--r--generic/tclPathObj.c2
3 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6ea446c..aabc5e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-05-21 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclFileName.c: When using Tcl_SetObjLength() calls to grow
+ * generic/tclPathObj.c: and shrink the objPtr->bytes buffer, care must be
+ taken that the value cannot possibly become pure Unicode. Calling
+ Tcl_AppendToObj() has the possibility of making such a conversion. Bug
+ found while valgrinding the trunk.
+
2012-05-17 Donal K. Fellows <dkf@users.sf.net>
* generic/tclCmdMZ.c (Tcl_SwitchObjCmd): [Bug 3106532]: Corrected
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 1fca08b..4c57256 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -857,7 +857,7 @@ TclpNativeJoinPath(
if (length > 0 && (start[length-1] != '/')) {
Tcl_AppendToObj(prefix, "/", 1);
- length++;
+ Tcl_GetStringFromObj(prefix, &length);
}
needsSep = 0;
@@ -893,7 +893,7 @@ TclpNativeJoinPath(
if ((length > 0) &&
(start[length-1] != '/') && (start[length-1] != ':')) {
Tcl_AppendToObj(prefix, "/", 1);
- length++;
+ Tcl_GetStringFromObj(prefix, &length);
}
needsSep = 0;
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index b6f3205..cde554c 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -1091,7 +1091,7 @@ Tcl_FSJoinPath(
if (length > 0 && ptr[length -1] != '/') {
Tcl_AppendToObj(res, &separator, 1);
- length++;
+ Tcl_GetStringFromObj(res, &length);
}
Tcl_SetObjLength(res, length + (int) strlen(strElt));