You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PE.relocate_image invokes parse_data_directories if the object doesn't have
the attribute DIRECTORY_ENTRY_BASERELOC yet.
However a verification that parse_data_directories actually created self.DIRECTORY_ENTRY_BASERELOC is missing and the function directly uses DIRECTORY_ENTRY_BASERELOC resulting in the exception:
AttributeError: 'PE' object has no attribute 'DIRECTORY_ENTRY_BASERELOC'
Traceback (most recent call last):
File "fuzz_pefile.py", line 22, in TestOneInput
p.relocate_image(0x40000)
File "pefile.py", line 5524, in relocate_image
for reloc in self.DIRECTORY_ENTRY_BASERELOC:
Other functions that use parse_data_directories are not missing this check.
Pefile attempts to parse the `DIRECTORY_ENTRY_BASERELOC` if it has not been parsed yet, but it may not exist or be unparseable. Check for that case, log a warning, and don't crash.
PE.relocate_image
invokesparse_data_directories
if the object doesn't havethe attribute
DIRECTORY_ENTRY_BASERELOC
yet.However a verification that
parse_data_directories
actually createdself.DIRECTORY_ENTRY_BASERELOC
is missing and the function directly usesDIRECTORY_ENTRY_BASERELOC
resulting in the exception:Other functions that use
parse_data_directories
are not missing this check.Crash file: crash-8ffa487ba8fe2bc6f6af1e9ba464aea5aba58374
The text was updated successfully, but these errors were encountered: