Skip to content
Permalink
Browse files
UBSAN UndefinedBehaviorSanitizer: undefined-behavior ../mysys/hash.c:…
…798:9
  • Loading branch information
kevgs committed Oct 3, 2020
1 parent dab56d5 commit 34cf947
Showing 1 changed file with 2 additions and 3 deletions.
@@ -792,14 +792,13 @@ void my_hash_replace(HASH *hash, HASH_SEARCH_STATE *current_record,
my_bool my_hash_iterate(HASH *hash, my_hash_walk_action action, void *argument)
{
uint records, i;
HASH_LINK *data;

records= hash->records;
data= dynamic_element(&hash->array,0,HASH_LINK*);

for (i= 0 ; i < records ; i++)
{
if ((*action)(data[i].data, argument))
if ((*action)(dynamic_element(&hash->array, i, HASH_LINK *)->data,
argument))
return 1;
}
return 0;

0 comments on commit 34cf947

Please sign in to comment.