diff options
author | dgp <dgp@noemail.net> | 2009-03-21 02:54:23 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2009-03-21 02:54:23 (GMT) |
commit | 841e8c43d393618a0b7a77e6667e9d1b239cec93 (patch) | |
tree | 07c6c36f119d562a59788ed599bca44cae6a7247 /generic/tclStringObj.c | |
parent | 206cc34ae280444acbf0b4a464139bd014b7419b (diff) | |
download | tcl-841e8c43d393618a0b7a77e6667e9d1b239cec93.zip tcl-841e8c43d393618a0b7a77e6667e9d1b239cec93.tar.gz tcl-841e8c43d393618a0b7a77e6667e9d1b239cec93.tar.bz2 |
* generic/tclStringObj.c: Test stringObj-6.9 checks that
* tests/stringObj.test: Tcl_AppendStringsToObj() no longer
crashes when operating on a pure unicode value. [Bug 2597185]
FossilOrigin-Name: 2ad13d8bb64450031cf3e1939503d8d1442057d9
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r-- | generic/tclStringObj.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index e7c8aae..6775273 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -33,7 +33,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclStringObj.c,v 1.70.2.6 2009/02/05 13:59:20 dgp Exp $ */ + * RCS: @(#) $Id: tclStringObj.c,v 1.70.2.7 2009/03/21 02:54:23 dgp Exp $ */ #include "tclInt.h" #include "tommath.h" @@ -1548,6 +1548,13 @@ Tcl_AppendStringsToObjVA( SetStringFromAny(NULL, objPtr); /* + * Force the existence of a string rep. so we avoid crashes operating + * on a pure unicode value. [Bug 2597185] + */ + + (void) Tcl_GetStringFromObj(objPtr, &oldLength); + + /* * Figure out how much space is needed for all the strings, and expand the * string representation if it isn't big enough. If no bytes would be * appended, just return. Note that on some platforms (notably OS/390) the @@ -1556,7 +1563,6 @@ Tcl_AppendStringsToObjVA( nargs = 0; newLength = 0; - oldLength = objPtr->length; while (1) { string = va_arg(argList, char *); if (string == NULL) { |