summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-05-21 16:56:27 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-05-21 16:56:27 (GMT)
commitc7d1fc7e920d1266c98e2df5a2e4d5513f7ffb55 (patch)
treef30c1902d727ee732c8814a1aa59eeae6b54a80b /generic/tclPathObj.c
parent01d4bddd243fd395b3d013a78e490daec26f048b (diff)
parent3d7e78f01cd6ddb05fa76bfc7aeb0c9c61392dfa (diff)
downloadtcl-c7d1fc7e920d1266c98e2df5a2e4d5513f7ffb55.zip
tcl-c7d1fc7e920d1266c98e2df5a2e4d5513f7ffb55.tar.gz
tcl-c7d1fc7e920d1266c98e2df5a2e4d5513f7ffb55.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 4f86755..2402128 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -1087,7 +1087,7 @@ TclJoinPath(
if (length > 0 && ptr[length -1] != '/') {
Tcl_AppendToObj(res, &separator, 1);
- length++;
+ Tcl_GetStringFromObj(res, &length);
}
Tcl_SetObjLength(res, length + (int) strlen(strElt));