Closed pwhelan closed 7 months ago
This code will fail, at the very least when using ASAn:
cfl_variant_destroy(array->entries[position]); if (position != array->entry_count - 1) { memcpy(&array->entries[position], &array->entries[position + 1], sizeof(void *) * (array->entry_count - (position + 1))); } else { array->entries[position] = NULL;
This is because you will inevitably be copying over the remaining values on top of the value being removed.
This fix just replaces memcpy for memmove which allows for src and dst to overlap.
thanks
This code will fail, at the very least when using ASAn:
This is because you will inevitably be copying over the remaining values on top of the value being removed.
This fix just replaces memcpy for memmove which allows for src and dst to overlap.