From 2bfdc581ba334338f7ae48607cd1bf269815f587 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 6 May 2009 20:16:55 +0000 Subject: * generic/tclCmdMZ.c: Improve overflow error message from [string repeat]. [Bug 2582327] --- ChangeLog | 5 +++++ generic/tclCmdMZ.c | 4 ++-- generic/tclExecute.c | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b54cfc..cd5c822 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-06 Don Porter + + * generic/tclCmdMZ.c: Improve overflow error message from + [string repeat]. [Bug 2582327] + 2009-04-28 Jeff Hobbs * unix/tcl.m4, unix/configure (SC_CONFIG_CFLAGS): harden the check diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 0e5330d..5a88a6f 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdMZ.c,v 1.163.2.2 2009/02/04 18:57:47 dgp Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.163.2.3 2009/05/06 20:16:55 dgp Exp $ */ #include "tclInt.h" @@ -2141,7 +2141,7 @@ StringReptCmd( if (count > (INT_MAX / length1)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "max size for a Tcl value (%d bytes) exceeded", INT_MAX)); + "result exceeds max size for a Tcl value (%d bytes)", INT_MAX)); return TCL_ERROR; } length2 = length1 * count; diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 3bf099e..c1b13b5 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.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: tclExecute.c,v 1.369.2.7 2009/03/20 14:35:06 dgp Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.369.2.8 2009/05/06 20:16:55 dgp Exp $ */ #include "tclInt.h" @@ -2121,6 +2121,7 @@ TclExecuteByteCode( } if (appendLen < 0) { + /* TODO: convert panic to error ? */ Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX); } @@ -2148,6 +2149,7 @@ TclExecuteByteCode( objResultPtr = OBJ_AT_DEPTH(opnd-1); bytes = TclGetStringFromObj(objResultPtr, &length); if (length + appendLen < 0) { + /* TODO: convert panic to error ? */ Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX); } #if !TCL_COMPILE_DEBUG -- cgit v0.12