Commit 34cf947e authored by Eugene Kosov's avatar Eugene Kosov

UBSAN UndefinedBehaviorSanitizer: undefined-behavior ../mysys/hash.c:798:9

parent dab56d5e
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment