summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-05-21 16:48:39 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-05-21 16:48:39 (GMT)
commita6a7e5ca7699ad328ed645c207aaba8b69e32a53 (patch)
treec022ea2ecf0d6c718230934201019c089f7d78c3 /generic/tclPathObj.c
parent70e6283bef9733ca12935627fda82f732e5cabd9 (diff)
parenta89ca11a44b7af7cb1017a6cbaf59f53c3e16ed7 (diff)
downloadtcl-a6a7e5ca7699ad328ed645c207aaba8b69e32a53.zip
tcl-a6a7e5ca7699ad328ed645c207aaba8b69e32a53.tar.gz
tcl-a6a7e5ca7699ad328ed645c207aaba8b69e32a53.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/tclPathObj.c')
-rw-r--r--generic/tclPathObj.c2
1 files changed, 1 insertions, 1 deletions
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));