diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-09 15:37:27 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-09 15:37:27 (GMT) |
| commit | 1c58938f2cff44bd2447ac657f8451c385097def (patch) | |
| tree | 7763b93cd8e916766d4e8bae2c271e87eb0951ba | |
| parent | 051f9006efbeea4b577bcdc748351ed3604964ce (diff) | |
| download | tcl-1c58938f2cff44bd2447ac657f8451c385097def.zip tcl-1c58938f2cff44bd2447ac657f8451c385097def.tar.gz tcl-1c58938f2cff44bd2447ac657f8451c385097def.tar.bz2 | |
Restore panic check at and of the loop. Thanks! Don for noticing this.
| -rw-r--r-- | generic/tclUtil.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c index c6dd464..68567b0 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -1509,10 +1509,13 @@ Tcl_Merge( for (i = 0; i < argc; i++) { flagPtr[i] = ( i ? TCL_DONT_QUOTE_HASH : 0 ); bytesNeeded += TclScanElement(argv[i], -1, &flagPtr[i]); - if ((bytesNeeded < 0) || (bytesNeeded > INT_MAX - argc + 1)) { + if (bytesNeeded < 0) { Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX); } } + if (bytesNeeded > INT_MAX - argc + 1) { + Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX); + } bytesNeeded += argc; /* |
