From 148e4d178f75cba1bfd43ca869360e5cbfb34d93 Mon Sep 17 00:00:00 2001 From: vasiljevic Date: Fri, 2 Apr 2010 14:30:40 +0000 Subject: * generic/tclStringObj.c: (SetStringFromAny): avoid trampling over the tclEmptyStringRep->bytes as it is thread-shared (thx to Gustaf Neumann for the (hard) work of locating this one). --- ChangeLog | 6 ++++++ generic/tclStringObj.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54354dc..4db08b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-04-02 Zoran Vasiljevic + + * generic/tclStringObj.c: (SetStringFromAny): avoid trampling + over the tclEmptyStringRep->bytes as it is thread-shared + (thx to Gustaf Neumann for the (hard) work of locating this one). + 2010-03-31 Donal K. Fellows * doc/package.n: [Bug 2980210]: Document the arguments taken by diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index ab6a600..f91322c 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.20 2010/03/29 21:57:33 dgp Exp $ */ + * RCS: @(#) $Id: tclStringObj.c,v 1.70.2.21 2010/04/02 14:30:41 vasiljevic Exp $ */ #include "tclInt.h" #include "tommath.h" @@ -2948,7 +2948,9 @@ SetStringFromAny( if (objPtr->bytes != NULL) { stringPtr->allocated = objPtr->length; - objPtr->bytes[objPtr->length] = 0; + if (objPtr->bytes != tclEmptyStringRep) { + objPtr->bytes[objPtr->length] = 0; + } } else { objPtr->length = 0; } -- cgit v0.12