Fix an out-of-bounds read in assoc_next.
Found using HWASan.
This commit is contained in:
parent
ab5074fdd5
commit
1bcf3c83c9
2
assoc.c
2
assoc.c
@ -128,7 +128,7 @@ const char *assoc_next(struct assoc *assoc, void **value, unsigned long *iter)
|
|||||||
{
|
{
|
||||||
unsigned long it = *iter;
|
unsigned long it = *iter;
|
||||||
|
|
||||||
while (!assoc->keys[it] && it < assoc->size)
|
while (it < assoc->size && !assoc->keys[it])
|
||||||
it++;
|
it++;
|
||||||
|
|
||||||
if (it == assoc->size)
|
if (it == assoc->size)
|
||||||
|
Loading…
Reference in New Issue
Block a user