summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2010-04-30 20:52:51 (GMT)
committerdgp <dgp@users.sourceforge.net>2010-04-30 20:52:51 (GMT)
commitfc29863f3fe1e359b0a7727e0b8a46d7b5cef69e (patch)
tree1e6f657a3753fec35f1cec4796c310ee5a4cc91a /generic/tclStringObj.c
parent312f44ead9b03addb227c8fb0ee54ba9310a8032 (diff)
downloadtcl-fc29863f3fe1e359b0a7727e0b8a46d7b5cef69e.zip
tcl-fc29863f3fe1e359b0a7727e0b8a46d7b5cef69e.tar.gz
tcl-fc29863f3fe1e359b0a7727e0b8a46d7b5cef69e.tar.bz2
* generic/tclBinary.c (TclAppendBytesToByteArray): Add comments
* generic/tclInt.h (TclAppendBytesToByteArray): placing overflow protection responsibility on caller. Convert "len" argument to signed int which any value already vetted for overflow issues will fit into. * generic/tclStringObj.c: Update caller; standardize panic msg. * generic/tclBinary.c (UpdateStringOfByteArray): Add panic when the generated string representation would grow beyond Tcl's size limits. [Bug 2994924]
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index e91b8a4..9e2e3aa 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.136 2010/04/29 15:08:07 dkf Exp $ */
+ * RCS: @(#) $Id: tclStringObj.c,v 1.137 2010/04/30 20:52:51 dgp Exp $ */
#include "tclInt.h"
#include "tommath.h"
@@ -1248,10 +1248,10 @@ Tcl_AppendObjToObj(
(void) Tcl_GetByteArrayFromObj(appendObjPtr, &lengthSrc);
lengthTotal = length + lengthSrc;
if (((length > lengthSrc) ? length : lengthSrc) > lengthTotal) {
- Tcl_Panic("overflow when calculating byte array size");
+ Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
}
bytesSrc = Tcl_GetByteArrayFromObj(appendObjPtr, NULL);
- TclAppendBytesToByteArray(objPtr, bytesSrc, (unsigned) lengthSrc);
+ TclAppendBytesToByteArray(objPtr, bytesSrc, lengthSrc);
return;
}