From 7c888dfa6e67e13dd89c459df3ee28f13ab681ec Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 28 Jul 2011 19:07:53 +0200 Subject: [PATCH] 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. --- libguile/hashtab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libguile/hashtab.c b/libguile/hashtab.c index 6141e4fd2..c4f2b5eb0 100644 --- a/libguile/hashtab.c +++ b/libguile/hashtab.c @@ -274,7 +274,7 @@ make_hash_table (int flags, unsigned long k, const char *func_name) SCM vector; scm_t_hashtable *t; 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; n = hashtable_size[i];