Commit 52fe4770 by devttys0

Fixed bug in processing internal extractors; if extractor raises an exception,…

Fixed bug in processing internal extractors; if extractor raises an exception, explicitly mark it as failed.
parent c4f37b8e
......@@ -801,9 +801,11 @@ class Magic(object):
if dlen is None:
dlen = len(data)
sc = 0
for signature in self.signatures:
# Use regex to search the data block for potential signature
# matches (fast)
sc += 1
for match in signature.regex.finditer(data):
# Take the offset of the start of the signature into account
offset = match.start() - signature.offset
......@@ -827,7 +829,7 @@ class Magic(object):
continue
else:
self.display_once.add(signature.title)
# Append the result to the results list
results.append(SignatureResult(**tags))
......
......@@ -474,7 +474,6 @@ class Module(object):
# as enabled
if not self.enabled:
self.enabled = True
self.validate(r)
self._plugins_result(r)
......
......@@ -861,6 +861,7 @@ class Extractor(Module):
except KeyboardInterrupt as e:
raise e
except Exception as e:
retval = False
binwalk.core.common.warning("Internal extractor '%s' failed with exception: '%s'" % (str(cmd), str(e)))
elif cmd:
# If not in debug mode, create a temporary file to redirect
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment