Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Schamper committed Jan 22, 2024
1 parent c6dfc6f commit cad8549
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dissect/util/compression/xz.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def repair_checksum(fh: BinaryIO) -> BinaryIO:
fh: A file-like object of an LZMA stream to repair.
"""
file_size = fh.seek(0, io.SEEK_END)
repaired = OverlayStream(fh, size)
repaired = OverlayStream(fh, file_size)
fh.seek(0)

header = fh.read(HEADER_FOOTER_SIZE)
Expand All @@ -32,7 +32,7 @@ def repair_checksum(fh: BinaryIO) -> BinaryIO:
raise ValueError("Not an XZ file")

Check warning on line 32 in dissect/util/compression/xz.py

View check run for this annotation

Codecov / codecov/patch

dissect/util/compression/xz.py#L32

Added line #L32 was not covered by tests

# Add correct header CRC32
repaired.add(8, _crc32(header[6:8]))
repaired.add(HEADER_FOOTER_SIZE - CRC_SIZE, _crc32(header[6:8]))

footer_offset = fh.seek(-HEADER_FOOTER_SIZE, io.SEEK_END)
footer = fh.read(HEADER_FOOTER_SIZE)
Expand Down

0 comments on commit cad8549

Please sign in to comment.