Skip to content

Commit 5cf45a1

Browse files
committed
fix(handler): introduce upper size limit for s_log_block_size
The maximum block size limit on a 64bit system is 65536 When creating a fake filesystem with `mkfs.ext4` and setting the block size to -b 65536, the maximum value that s_log_block_size will reach is six.
1 parent d7dc6db commit 5cf45a1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

unblob/handlers/filesystem/extfs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ def valid_header(self, header) -> bool:
8484
"ExtFS header major version too high", rev_level=header.s_rev_level
8585
)
8686
return False
87+
if header.s_log_block_size > 6:
88+
logger.debug("ExtFS header s_log_block_size is too large", s_log_block_size=header.s_log_block_size)
89+
return False
8790
return True
8891

8992
def calculate_chunk(self, file: File, start_offset: int) -> Optional[ValidChunk]:

0 commit comments

Comments
 (0)