diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2011-04-13 11:03:30 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2011-04-13 11:03:30 (GMT) |
| commit | 9f364eb26b69c4d61c666b024b3b3bb6431600fe (patch) | |
| tree | afcc09a79fc200634cc3c3b8c7651d33219cf206 /generic/tclUtil.c | |
| parent | d40df3e128b52d097e2a2d37e59ca3b904eef869 (diff) | |
| download | tcl-9f364eb26b69c4d61c666b024b3b3bb6431600fe.zip tcl-9f364eb26b69c4d61c666b024b3b3bb6431600fe.tar.gz tcl-9f364eb26b69c4d61c666b024b3b3bb6431600fe.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.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) { |
