summaryrefslogtreecommitdiffstats
path: root/generic/tclIOUtil.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-05-21 16:17:11 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-05-21 16:17:11 (GMT)
commita89ca11a44b7af7cb1017a6cbaf59f53c3e16ed7 (patch)
tree666912b90f513715a922d466b249751d4edcf6fa /generic/tclIOUtil.c
parent03716dfee8f0f0df26a8c56e6a2b3ceeb9319dbc (diff)
downloadtcl-a89ca11a44b7af7cb1017a6cbaf59f53c3e16ed7.zip
tcl-a89ca11a44b7af7cb1017a6cbaf59f53c3e16ed7.tar.gz
tcl-a89ca11a44b7af7cb1017a6cbaf59f53c3e16ed7.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/tclIOUtil.c')
-rw-r--r--generic/tclIOUtil.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index d50f2e3..40f3f76 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -4977,7 +4977,7 @@ Tcl_FSJoinPath(listObj, elements)
if (length > 0 && ptr[length -1] != '/') {
Tcl_AppendToObj(res, &separator, 1);
- length++;
+ Tcl_GetStringFromObj(res, &length);
}
Tcl_SetObjLength(res, length + (int) strlen(strElt));