summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-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) {