From 7b1f9159604d4005f984eb3f32a4be126e5a4834 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 7 Mar 2011 22:23:11 +0000 Subject: Fix [Bug 3166410]: "out of stack space" on AIX --- ChangeLog | 4 ++++ unix/tclUnixInit.c | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index e33ff69..7f54c6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-03-07 Jan Nijtmans + + * unix/tclUnixInit: + 2011-03-06 Don Porter * generic/tclBasic.c: More replacements of Tcl_UtfBackslash() calls diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index a798ccb..5111746 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -1092,9 +1092,19 @@ TclpGetCStackParams( if (stackGrowsDown) { tsdPtr->stackBound = (int *) ((char *)tsdPtr->outerVarPtr - stackSize); + if (tsdPtr->stackBound > tsdPtr->outerVarPtr) { + /* Overflow, that should never happen, just set it to NULL. + * See [Bug #3166410] */ + tsdPtr->stackBound = NULL; + } } else { tsdPtr->stackBound = (int *) ((char *)tsdPtr->outerVarPtr + stackSize); + if (tsdPtr->stackBound < tsdPtr->outerVarPtr) { + /* Overflow, that should never happen, just set it to NULL. + * See [Bug #3166410] */ + tsdPtr->stackBound = NULL; + } } } -- cgit v0.12