-
Notifications
You must be signed in to change notification settings - Fork 102
negative seeking in XZ handler #270
Copy link
Copy link
Closed
Labels
Milestone
Description
Came upon a sample that made XZ seek before the start of the file:
Traceback (most recent call last):
File "/home/quentin/unblob/unblob/finder.py", line 75, in search_chunks_by_priority
chunk = handler.calculate_chunk(limited_reader, real_offset)
File "/home/quentin/unblob/unblob/handlers/compression/xz.py", line 74, in calculate_chunk
file.seek(-real_backward_size, io.SEEK_CUR)
File "/home/quentin/unblob/unblob/file_utils.py", line 204, in seek
new_pos = self._file.seek(offset, whence)
OSError: [Errno 22] Invalid argument
We should verify that real_backward_size is not larger than our current position in the file.
Reactions are currently unavailable