diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclZlib.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c index 2ae12c0..f43f704 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclZlib.c,v 1.32 2009/11/18 21:59:51 nijtmans Exp $ + * RCS: @(#) $Id: tclZlib.c,v 1.33 2010/02/08 13:21:42 dkf Exp $ */ #include "tclInt.h" @@ -1316,6 +1316,15 @@ Tcl_ZlibDeflate( obj = Tcl_GetObjResult(interp); /* + * Make sure that the result is an unshared object. [Bug 2947783] + */ + + if (Tcl_IsShared(obj)) { + obj = Tcl_DuplicateObj(obj); + Tcl_SetObjResult(interp, obj); + } + + /* * Compressed format is specified by the wbits parameter. See zlib.h for * details. */ @@ -1469,6 +1478,15 @@ Tcl_ZlibInflate( obj = Tcl_GetObjResult(interp); /* + * Make sure that the result is an unshared object. [Bug 2947783] + */ + + if (Tcl_IsShared(obj)) { + obj = Tcl_DuplicateObj(obj); + Tcl_SetObjResult(interp, obj); + } + + /* * Compressed format is specified by the wbits parameter. See zlib.h for * details. */ |