mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
Fix TypeError exception in Python3
`va` can be None and this causes Python 3 to raise a TypeError exception. This is caused by the following breaking change in Python3: > The ordering comparison operators (<, <=, >=, >) raise a TypeError > exception when the operands don’t have a meaningful natural ordering. This didn't failed in the previously tried vivisect version (master from one week ago and not the release). This may have been caused by a bug in vivisect that has been fixed.
This commit is contained in:
@@ -488,7 +488,7 @@ def extract_insn_segment_access_features(f, bb, insn):
|
||||
|
||||
def get_section(vw, va):
|
||||
for start, length, _, __ in vw.getMemoryMaps():
|
||||
if start <= va < start + length:
|
||||
if va and start <= va < start + length:
|
||||
return start
|
||||
|
||||
raise KeyError(va)
|
||||
|
||||
Reference in New Issue
Block a user