summaryrefslogtreecommitdiffstats
path: root/generic/tclEnv.c
diff options
context:
space:
mode:
authorkennykb <kennykb@noemail.net>2007-04-23 17:34:04 (GMT)
committerkennykb <kennykb@noemail.net>2007-04-23 17:34:04 (GMT)
commit238fdb2ce3ce36020c9ebd34acaa88b5f888fa6b (patch)
tree2797649b1f689dcf56aa42cd39b149ed9ceb4476 /generic/tclEnv.c
parentbcb8457b10aecc2f1dc200c91e2c16c1109dd4d7 (diff)
downloadtcl-238fdb2ce3ce36020c9ebd34acaa88b5f888fa6b.zip
tcl-238fdb2ce3ce36020c9ebd34acaa88b5f888fa6b.tar.gz
tcl-238fdb2ce3ce36020c9ebd34acaa88b5f888fa6b.tar.bz2
* generic/tclEnv.c (ReplaceString): Clear memory correctly when
growing the cache to avoid reads of uninitialised data. * generic/tclStrToD.c (AccumulateDecimalDigit): Fixed a mistake where we'd run beyond the end of the 'pow10_wide' array if a number begins with a string of more than 'maxpow10_wide' zeroes. Both these issues reported under [Bug 1705778] - detected with the existing test suite, no new regression tests required. FossilOrigin-Name: 10fb68199ea8f71f776217823469af7a4320b8b2
Diffstat (limited to 'generic/tclEnv.c')
-rw-r--r--generic/tclEnv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/generic/tclEnv.c b/generic/tclEnv.c
index 596e68b..30bce65 100644
--- a/generic/tclEnv.c
+++ b/generic/tclEnv.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclEnv.c,v 1.32 2007/04/10 14:47:13 dkf Exp $
+ * RCS: @(#) $Id: tclEnv.c,v 1.33 2007/04/23 17:34:06 kennykb Exp $
*/
#include "tclInt.h"
@@ -677,7 +677,8 @@ ReplaceString(
environCache = (char **) ckrealloc ((char *) environCache,
(cacheSize + growth) * sizeof(char *));
environCache[cacheSize] = newStr;
- (void) memset(environCache+cacheSize+1, (int) 0, (size_t) (growth - 1));
+ (void) memset(environCache+cacheSize+1, (int) 0,
+ (size_t) ((growth-1) * sizeof(char*)));
cacheSize += growth;
}
}