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
4 changes: 3 additions & 1 deletion src/xmlcli/common/bios_fw_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ def store_guid(self, buffer, start, end, guid, nesting_level, is_compressed=Fals
def is_valid_fv(firmware_volume_header):
has_valid_signature = firmware_volume_header.Signature == structure.FV_SIGNATURE
has_valid_zero_vector = utils.get_integer_value(firmware_volume_header.get_value("ZeroVector")) == 0
if has_valid_signature and has_valid_zero_vector:
# FvLength must be non-zero to guarantee forward progress on the recursive parse walk
has_valid_length = utils.get_integer_value(firmware_volume_header.get_value("FvLength")) > 0
if has_valid_signature and has_valid_zero_vector and has_valid_length:
return True
else:
log.debug(firmware_volume_header.dump_dict())
Expand Down
Loading