summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2011-04-13 11:03:30 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2011-04-13 11:03:30 (GMT)
commit4884764d1d8d9cf7bd61e25622b0173c43e46114 (patch)
treeafcc09a79fc200634cc3c3b8c7651d33219cf206 /generic/tclUtil.c
parentac9480ca488c245a75ac57acd5ca9253de732edd (diff)
downloadtcl-4884764d1d8d9cf7bd61e25622b0173c43e46114.zip
tcl-4884764d1d8d9cf7bd61e25622b0173c43e46114.tar.gz
tcl-4884764d1d8d9cf7bd61e25622b0173c43e46114.tar.bz2
[3285375]: Make the crash less mysterious through the judicious use of a panic.
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 64aa824..46ddf85 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -1110,10 +1110,15 @@ Tcl_ConcatObj(
allocSize = 0;
for (i = 0; i < objc; i++) {
+ int oldAllocSize = allocSize;
+
objPtr = objv[i];
element = TclGetStringFromObj(objPtr, &length);
if ((element != NULL) && (length > 0)) {
allocSize += (length + 1);
+ if (allocSize < oldAllocSize) {
+ Tcl_Panic("too much memory required");
+ }
}
}
if (allocSize == 0) {