1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

fix read beyond end of hashtable size array in hashtab.c

* libguile/hashtab.c (make_hash_table): Fix read beyond end of
  hashtable_size array.  Thanks to
  http://article.gmane.org/gmane.lisp.guile.devel/12685.
This commit is contained in:
Andy Wingo 2011-07-28 19:07:53 +02:00
parent eff3dd99f7
commit 7c888dfa6e

View file

@ -274,7 +274,7 @@ make_hash_table (int flags, unsigned long k, const char *func_name)
SCM vector; SCM vector;
scm_t_hashtable *t; scm_t_hashtable *t;
int i = 0, n = k ? k : 31; int i = 0, n = k ? k : 31;
while (i < HASHTABLE_SIZE_N && n > hashtable_size[i]) while (i + 1 < HASHTABLE_SIZE_N && n > hashtable_size[i])
++i; ++i;
n = hashtable_size[i]; n = hashtable_size[i];