1
0
Fork 0
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:
Thomas Waldmann 2015-08-29 04:46:13 +02:00
parent 1a949eab3e
commit d779057b79

View file

@ -380,8 +380,8 @@ hashindex_summarize(HashIndex *index, long long *total_size, long long *total_cs
chunks += values[0];
unique_size += values[1];
unique_csize += values[2];
size += values[0] * values[1];
csize += values[0] * values[2];
size += (int64_t) values[0] * values[1];
csize += (int64_t) values[0] * values[2];
}
*total_size = size;
*total_csize = csize;