From 4884764d1d8d9cf7bd61e25622b0173c43e46114 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 13 Apr 2011 11:03:30 +0000 Subject: [3285375]: Make the crash less mysterious through the judicious use of a panic. --- ChangeLog | 27 +++++++++++++++++---------- generic/tclUtil.c | 5 +++++ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index cc68aaa..7bf374c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-04-13 Donal K. Fellows + + * generic/tclUtil.c (Tcl_ConcatObj): [Bug 3285375]: Make the crash + less mysterious through the judicious use of a panic. Not yet properly + fixed, but at least now clearer what the failure mode is. + 2011-04-12 Don Porter * tests/string.test: Test for [Bug 3285472]. Not buggy in trunk. @@ -8,31 +14,32 @@ 2011-04-12 Miguel Sofer - * generic/tclBasic.c: fix for [Bug 2440625], kbk's patch + * generic/tclBasic.c: Fix for [Bug 2440625], kbk's patch 2011-04-11 Miguel Sofer * generic/tclBasic.c: - * tests/coroutine.test: insure that 'coroutine eval' runs the initial - command in the proper context, [Bug 3282869] - + * tests/coroutine.test: [Bug 3282869]: Ensure that 'coroutine eval' + runs the initial command in the proper context. + 2011-04-11 Jan Nijtmans - * generic/tcl.h: fix for [Bug 3281728]: Tcl sources from 2011-04-06 do - * unix/tcl.m4: not build on GCC9 (RH9) + + * generic/tcl.h: Fix for [Bug 3281728]: Tcl sources from 2011-04-06 + * unix/tcl.m4: do not build on GCC9 (RH9) * unix/configure: 2011-04-08 Jan Nijtmans - * win/tclWinPort.h: fix for [Bug 3280043]: win2k: unresolved DLL imports - * win/configure.in + * win/tclWinPort.h: Fix for [Bug 3280043]: win2k: unresolved DLL + * win/configure.in: imports. * win/configure 2011-04-06 Miguel Sofer - * generic/tclExecute.c (TclCompileObj): earlier return if Tip280 + * generic/tclExecute.c (TclCompileObj): Earlier return if Tip280 gymnastics not needed. - * generic/tclExecute.c: fix for [Bug 3274728], making *catchTop an + * generic/tclExecute.c: Fix for [Bug 3274728]: making *catchTop an unsigned long. 2011-04-06 Jan Nijtmans 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) { -- cgit v0.12