1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 17:27:31 +00:00

transfer: fix csize/psize for obfuscated chunks

This commit is contained in:
Thomas Waldmann 2022-09-08 23:27:19 +02:00
parent 36e852457a
commit bca36db0a1

View file

@ -123,8 +123,10 @@ def upgrade_zlib_and_level(meta, data):
csize = borg1_header_fmt.unpack(csize_bytes)
compressed = data[2 + hlen : 2 + hlen + csize]
meta, compressed = upgrade_zlib_and_level(meta, compressed)
meta["psize"] = csize
osize = len(data) - 2 - hlen - csize # amount of 0x00 bytes appended for obfuscation
data = compressed + bytes(osize)
meta["csize"] = len(data)
else:
meta, data = upgrade_zlib_and_level(meta, data)
return meta, data