mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-23 00:07:38 +00:00
fix issue with negative "all archives" size, fixes #165
This fixes a infrequent problem when (refcount * chunksize) overflowed a int32_t. chunksize is always <= 8MiB and usually rather ~64KiB (with default chunker params). Thus, this happened only for high refcounts and/or unusually big chunks.
This commit is contained in:
parent
1a949eab3e
commit
d779057b79
1 changed files with 2 additions and 2 deletions
|
@ -380,8 +380,8 @@ hashindex_summarize(HashIndex *index, long long *total_size, long long *total_cs
|
||||||
chunks += values[0];
|
chunks += values[0];
|
||||||
unique_size += values[1];
|
unique_size += values[1];
|
||||||
unique_csize += values[2];
|
unique_csize += values[2];
|
||||||
size += values[0] * values[1];
|
size += (int64_t) values[0] * values[1];
|
||||||
csize += values[0] * values[2];
|
csize += (int64_t) values[0] * values[2];
|
||||||
}
|
}
|
||||||
*total_size = size;
|
*total_size = size;
|
||||||
*total_csize = csize;
|
*total_csize = csize;
|
||||||
|
|
Loading…
Reference in a new issue