Skip to content

Commit

Permalink
Merge pull request #684 from onekey-sec/683-fix-sparse-tar
Browse files Browse the repository at this point in the history
improve tar handler to support sparse archives.
  • Loading branch information
qkaiser authored Dec 16, 2023
2 parents 41004be + 2b5a2fa commit ad76949
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tests/integration/archive/tar/__input__/sparse.tar
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
3 changes: 1 addition & 2 deletions unblob/handlers/archive/tar.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ def _get_end_of_last_tar_entry(file) -> int:
if last_member is None:
return -1

last_file_size = round_up(last_member.size, BLOCK_SIZE)
end_of_last_tar_entry = last_member.offset_data + last_file_size
end_of_last_tar_entry = tf.offset
try:
file.seek(end_of_last_tar_entry)
except SeekError:
Expand Down

0 comments on commit ad76949

Please sign in to comment.