Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ubireader/ubifs/walk.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ def _index(ubifs: Ubifs, lnum: int, offset: int, inodes: MutableMapping[int, Ino
log(index , '%s file addr: %s' % (chdr, ubifs.file.last_read_addr()))
verbose_display(chdr)
read_size = chdr.len - UBIFS_COMMON_HDR_SZ
if read_size < 0:
if settings.warn_only_block_read_errors:
error(index, 'Error', 'LEB: %s at %s, Node len (%s) < common header size, skipping.' % (lnum, ubifs.leb_size * lnum + offset, chdr.len))
return
else:
error(index, 'Fatal', 'LEB: %s at %s, Node len (%s) < common header size.' % (lnum, ubifs.leb_size * lnum + offset, chdr.len))
node_buf = ubifs.file.read(read_size)
file_offset = ubifs.file.last_read_addr()

Expand Down