Skip to content

Commit

Permalink
Broken MFT entries might not have a size_alloc. Fixes #79
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazza committed Jan 12, 2021
1 parent 89cbabd commit 67f5bf0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion recuperabit/fs/ntfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ def _attributes_reader(entry, offset):
def parse_file_record(entry):
"""Parse the contents of a FILE record (MFT entry)."""
header = unpack(entry, entry_fmt)
if (header['size_alloc'] > len(entry) or
if (header['size_alloc'] is None or
header['size_alloc'] > len(entry) or
len(entry) < FILE_size*sector_size):
header['valid'] = False
return header
Expand Down

0 comments on commit 67f5bf0

Please sign in to comment.