From 8af7bf38453d71fecfc5e4e507d92e5220b5d5be Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 6 May 2009 20:16:16 +0000 Subject: * generic/tclCmdMZ.c: Improve overflow error message from [string repeat]. [Bug 2582327] --- ChangeLog | 3 +++ generic/tclCmdMZ.c | 4 ++-- generic/tclExecute.c | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d2b0610..9a8fb7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-05-06 Don Porter + * generic/tclCmdMZ.c: Improve overflow error message from + [string repeat]. [Bug 2582327] + * tests/interp.test: interp-20.50 test for Bug 2486550. 2009-05-04 Donal K. Fellows diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 296271c..bb0d3bd 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.182 2009/03/16 10:21:42 dkf Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.183 2009/05/06 20:16:17 dgp Exp $ */ #include "tclInt.h" @@ -2144,7 +2144,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 b00848a..a30c46e 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -14,7 +14,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.433 2009/03/21 09:42:07 msofer Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.434 2009/05/06 20:16:17 dgp Exp $ */ #include "tclInt.h" @@ -2440,6 +2440,7 @@ TclExecuteByteCode( } if (appendLen < 0) { + /* TODO: convert panic to error ? */ Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX); } @@ -2468,6 +2469,7 @@ TclExecuteByteCode( if (!onlyb) { 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); } @@ -2504,6 +2506,7 @@ TclExecuteByteCode( } else { bytes = (char *) Tcl_GetByteArrayFromObj(objResultPtr, &length); if (length + appendLen < 0) { + /* TODO: convert panic to error ? */ Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX); } -- cgit v0.12