mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-11 01:41:57 -04:00
reader: fix corruption issue "forgetting" all-zero bytestrings, fixes #8963
This commit is contained in:
parent
85582f1b13
commit
9877fe91c9
1 changed files with 5 additions and 4 deletions
|
|
@ -303,10 +303,11 @@ class FileReader:
|
|||
# For data chunks, add the actual data
|
||||
result.extend(data[self.offset:self.offset + to_read])
|
||||
else:
|
||||
# For non-data chunks, add zeros if we've seen a data chunk
|
||||
if has_data:
|
||||
result.extend(b'\0' * to_read)
|
||||
# Otherwise, we'll just track the size without adding data
|
||||
# For non-data chunks, always add zeros to the result.
|
||||
# We will only yield a CH_DATA chunk with the result bytes,
|
||||
# if there was at least one CH_DATA chunk contributing to the result,
|
||||
# otherwise we will yield a CH_HOLE or CH_ALLOC chunk.
|
||||
result.extend(b'\0' * to_read)
|
||||
|
||||
bytes_read += to_read
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue