diff --git a/fx.collections/hashtable.c b/fx.collections/hashtable.c index 54c556e..c2de440 100644 --- a/fx.collections/hashtable.c +++ b/fx.collections/hashtable.c @@ -623,6 +623,10 @@ static const fx_value *iterator_get_value(const fx_iterator *obj) struct table_item *table = it->_h_p->t_items; size_t capacity = primes[it->_h_p->t_max_index]; + if (it->i >= capacity) { + return NULL; + } + if (table[it->i].i_item) { return &it->item_value; }