diff options
author | hobbs <hobbs> | 2007-02-08 23:11:19 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2007-02-08 23:11:19 (GMT) |
commit | 32fbfcd067b767677bcc23086c5440407c7afa9d (patch) | |
tree | d647d9bc45dc513c834ca7d94f1cccbe0eb53f5b | |
parent | 5f3752c577b76184a8548e74176f2fa153842de9 (diff) | |
download | tcl-32fbfcd067b767677bcc23086c5440407c7afa9d.zip tcl-32fbfcd067b767677bcc23086c5440407c7afa9d.tar.gz tcl-32fbfcd067b767677bcc23086c5440407c7afa9d.tar.bz2 |
* unix/tclUnixInit.c (TclpCheckStackSpace): do stack size checks
with unsigned size_t to correctly validate stackSize in the 2^31+
range.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | unix/tclUnixInit.c | 6 |
2 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2007-02-08 Jeff Hobbs <jeffh@ActiveState.com> + + * unix/tclUnixInit.c (TclpCheckStackSpace): do stack size checks + with unsigned size_t to correctly validate stackSize in the 2^31+ + range. + 2007-02-08 Don Porter <dgp@users.sourceforge.net> * generic/tclNamesp.c: Corrected broken logic in Tcl_DeleteNamespace() diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 7db0e4c..3568bd6 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -7,7 +7,7 @@ * Copyright (c) 1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tclUnixInit.c,v 1.67 2006/09/10 17:04:07 das Exp $ + * RCS: @(#) $Id: tclUnixInit.c,v 1.68 2007/02/08 23:11:21 hobbs Exp $ */ #include "tclInt.h" @@ -1030,7 +1030,7 @@ TclpCheckStackSpace(void) /* Most variables are actually in a * thread-specific data block to minimise the * impact on the stack. */ - register ptrdiff_t stackUsed; + register size_t stackUsed; int localVar; /* Reference to somewhere on the local stack. * This is declared last so it's as "deep" as * possible. */ @@ -1089,7 +1089,7 @@ TclpCheckStackSpace(void) * Now we perform the actual check. Are we about to blow our stack frame? */ - if (stackUsed < (ptrdiff_t) tsdPtr->stackSize) { + if (stackUsed < tsdPtr->stackSize) { STACK_DEBUG(("stack OK\tin:%p\tout:%p\tuse:%04X\tmax:%04X\n", &localVar, tsdPtr->outerVarPtr, stackUsed, tsdPtr->stackSize)); return 1; |