Skip to content

Commit

Permalink
Merge pull request #95 from IVOES/fix-offset-use-before-range-check
Browse files Browse the repository at this point in the history
Fix offset used before range check
  • Loading branch information
gozfree authored May 27, 2023
2 parents c9162ed + c0b468c commit a0854bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gear-lib/libdict/libdict.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,8 @@ int dict_enumerate(dict * d, int rank, char ** key, char ** val)
return -1 ;
}

while ((d->table[rank].key == NULL || d->table[rank].key == DUMMY_PTR)
&& (rank < (int)d->size))
while ((rank < (int)d->size) &&
(d->table[rank].key == NULL || d->table[rank].key == DUMMY_PTR))
rank++;

if (rank >= (int)d->size) {
Expand Down

0 comments on commit a0854bd

Please sign in to comment.