summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixInit.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tclUnixInit.c')
-rw-r--r--unix/tclUnixInit.c10
1 files changed, 10 insertions, 0 deletions
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;
+ }
}
}