diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2020-01-19 20:54:05 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2020-01-19 20:54:05 +0200 |
commit | 357e542e5bba9e85a335d9cb17e4a5d666b79a74 (patch) | |
tree | 7f49c32b9a948383fcc9eb78a5bdc2da5a59b8ad | |
parent | 15db23b88c2866ed900177cbf11ce37e373e5e20 (diff) | |
parent | 49125fbf794508efdb71a4f6f18a4bc324bd76ab (diff) | |
download | egawk-357e542e5bba9e85a335d9cb17e4a5d666b79a74.tar.gz egawk-357e542e5bba9e85a335d9cb17e4a5d666b79a74.tar.bz2 egawk-357e542e5bba9e85a335d9cb17e4a5d666b79a74.zip |
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/gawk
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | cint_array.c | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -4,6 +4,12 @@ (pprint): Be smarter for print[f] with redirection that was parenthesized, to not print `printf(("hello\n")) > "..."'. +2020-01-14 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * cint_array.c (cint_array_init): Fix off-by-one error in array + bounds overflow check for an NHAT value set in the environment. + Thanks to Michael Builov <mbuilov@gmail.com> for the report. + 2020-01-08 Arnold D. Robbins <arnold@skeeve.com> Fix a number of subtle memory leaks. Thanks to the diff --git a/cint_array.c b/cint_array.c index 417f27d5..d7171ac8 100644 --- a/cint_array.c +++ b/cint_array.c @@ -175,7 +175,7 @@ cint_array_init(NODE *symbol ATTRIBUTE_UNUSED, NODE *subs ATTRIBUTE_UNUSED) if ((newval = getenv_long("NHAT")) > 1 && newval < INT32_BIT) NHAT = newval; /* don't allow overflow off the end of the table */ - if (NHAT >= nelems) + if (NHAT > nelems - 2) NHAT = nelems - 2; THRESHOLD = power_two_table[NHAT + 1]; } else |