mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-19189 ASAN memcpy-param-overlap in fill_alter_inplace_info upon adding indexes
memmove() should be used instead of memcpy() for overlapping memory regions. Overlapping memory regions itself here are fine, because code simply removes one element from arbitrary position of an array.
This commit is contained in:
@ -7123,10 +7123,10 @@ static bool fill_alter_inplace_info(THD *thd, TABLE *table, bool varchar,
|
||||
|
||||
--ha_alter_info->index_add_count;
|
||||
--ha_alter_info->index_drop_count;
|
||||
memcpy(add_buffer + i, add_buffer + i + 1,
|
||||
sizeof(add_buffer[0]) * (ha_alter_info->index_add_count - i));
|
||||
memcpy(drop_buffer + j, drop_buffer + j + 1,
|
||||
sizeof(drop_buffer[0]) * (ha_alter_info->index_drop_count - j));
|
||||
memmove(add_buffer + i, add_buffer + i + 1,
|
||||
sizeof(add_buffer[0]) * (ha_alter_info->index_add_count - i));
|
||||
memmove(drop_buffer + j, drop_buffer + j + 1,
|
||||
sizeof(drop_buffer[0]) * (ha_alter_info->index_drop_count - j));
|
||||
--i; // this index once again
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user