diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclStringObj.c | 4 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2012-02-09 Don Porter <dgp@users.sourceforge.net> + + * generic/tclStringObj.c: [Bug 3484402] Correct Off-By-One + error appending unicode. Thanks to Poor Yorick. Also corrected test + for when growth is needed. + 2012-02-06 Don Porter <dgp@users.sourceforge.net> * generic/tclCmdMZ.c: [Bug 3484621] Invalidate bytecode when exec diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index e8aee4b..7005223 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -1334,7 +1334,7 @@ AppendUnicodeToUnicodeRep(objPtr, unicode, appendNumChars) * trailing null. */ - memmove((VOID*) (stringPtr->unicode + stringPtr->numChars), unicode, + memcpy((VOID*) (stringPtr->unicode + stringPtr->numChars), unicode, appendNumChars * sizeof(Tcl_UniChar)); stringPtr->unicode[numChars] = 0; stringPtr->numChars = numChars; @@ -1514,7 +1514,7 @@ AppendUtfToUtfRep(objPtr, bytes, numBytes) stringPtr->numChars = -1; stringPtr->hasUnicode = 0; - memmove((VOID *) (objPtr->bytes + oldLength), (VOID *) bytes, + memcpy((VOID *) (objPtr->bytes + oldLength), (VOID *) bytes, (size_t) numBytes); objPtr->bytes[newLength] = 0; objPtr->length = newLength; |