diff options
author | dkf <dkf@noemail.net> | 2011-04-13 11:03:30 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2011-04-13 11:03:30 (GMT) |
commit | 37af6be5c74b7a6eff6382f6931fb0e5dd1a1449 (patch) | |
tree | afcc09a79fc200634cc3c3b8c7651d33219cf206 /generic/tclUtil.c | |
parent | 2328d9557f0abe882993fa705f34391c04247afc (diff) | |
download | tcl-37af6be5c74b7a6eff6382f6931fb0e5dd1a1449.zip tcl-37af6be5c74b7a6eff6382f6931fb0e5dd1a1449.tar.gz tcl-37af6be5c74b7a6eff6382f6931fb0e5dd1a1449.tar.bz2 |
[3285375]: Make the crash less mysterious through the judicious use of a panic.
FossilOrigin-Name: 398075e9b44634c3cf73c1436b6f75fcf092a3bb
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r-- | generic/tclUtil.c | 5 |
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) { |