Skip to content

Commit

Permalink
Merge pull request #765 from onekey-sec/764-squashfs-int-overflow
Browse files Browse the repository at this point in the history
fix(squashfs): fixed end_of_data_offset calculation
  • Loading branch information
qkaiser authored Feb 16, 2024
2 parents d013f69 + f52d3fd commit b47c2ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unblob/handlers/filesystem/squashfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def calculate_chunk(self, file: File, start_offset: int) -> Optional[ValidChunk]
endian = get_endian(file, self.BIG_ENDIAN_MAGIC)
header = self.parse_header(file, endian)

end_of_data_offset = start_offset + header.bytes_used
end_of_data_offset = (start_offset + header.bytes_used) & 0xFF_FF_FF_FF
file.seek(end_of_data_offset)
padding = file.read(
round_up(header.bytes_used, max(PAD_SIZES)) - header.bytes_used
Expand Down

0 comments on commit b47c2ce

Please sign in to comment.