mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-20 21:27:32 +00:00
hashindex_compact: use memmove for possibly overlapping copy
This commit is contained in:
parent
a75bfae2cf
commit
1d5d50463c
1 changed files with 2 additions and 1 deletions
|
@ -650,7 +650,8 @@ hashindex_compact(HashIndex *index)
|
||||||
begin_used_idx = idx;
|
begin_used_idx = idx;
|
||||||
|
|
||||||
if(!empty_slot_count) {
|
if(!empty_slot_count) {
|
||||||
memcpy(BUCKET_ADDR(index, compact_tail_idx), BUCKET_ADDR(index, idx), index->bucket_size);
|
/* In case idx==compact_tail_idx, the areas overlap */
|
||||||
|
memmove(BUCKET_ADDR(index, compact_tail_idx), BUCKET_ADDR(index, idx), index->bucket_size);
|
||||||
idx++;
|
idx++;
|
||||||
compact_tail_idx++;
|
compact_tail_idx++;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue