summaryrefslogtreecommitdiffstats
path: root/generic/tclFileName.c
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2012-05-21 16:17:11 (GMT)
committerdgp@users.sourceforge.net <dgp>2012-05-21 16:17:11 (GMT)
commitbe3d016f7ee554f33f41c38bc9adb86d09d659db (patch)
tree666912b90f513715a922d466b249751d4edcf6fa /generic/tclFileName.c
parent645b9b585f5ce517ebff86a96f43252e4354458f (diff)
downloadtcl-be3d016f7ee554f33f41c38bc9adb86d09d659db.zip
tcl-be3d016f7ee554f33f41c38bc9adb86d09d659db.tar.gz
tcl-be3d016f7ee554f33f41c38bc9adb86d09d659db.tar.bz2
When using Tcl_SetObjLength() calls to grow 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.
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r--generic/tclFileName.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 761c8be..c5ecf0f 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -1155,7 +1155,7 @@ TclpNativeJoinPath(prefix, joining)
if (length > 0 && (start[length-1] != '/')) {
Tcl_AppendToObj(prefix, "/", 1);
- length++;
+ Tcl_GetStringFromObj(prefix, &length);
}
needsSep = 0;
@@ -1194,7 +1194,7 @@ TclpNativeJoinPath(prefix, joining)
if ((length > 0) &&
(start[length-1] != '/') && (start[length-1] != ':')) {
Tcl_AppendToObj(prefix, "/", 1);
- length++;
+ Tcl_GetStringFromObj(prefix, &length);
}
needsSep = 0;