Description
I was testing out the latest code and ran into the same issue on the 3.0 release as the current head ca1de05. The code assumes that the regex match will return something correctly, which isn't always the case.
Line will still fail like issue #1300 and #1519 are intended to fix:
cve-bin-tool/cve_bin_tool/cve_scanner.py
Line 275 in ca1de05
I patched it (poorly) in my code to do the following:
try:
parsed_version = parse_version(pv.group(0))
except AttributeError:
parsed_version = parse_version("99.99.99")
self.logger.warn(
f"error parsing {product_info.vendor}.{product_info.product} v{product_info.version} - manual inspection required"
)
Likely there should be a configuration option on what happens if there's an error matching regular expressions, something like a "fail safe" and set the version to lowest possible value, which likely will create a lot of false positives, or "fail scary" which just drops a warning and tells the user to do manual inspection like I have above.
I'm happy to create a PR, but I'm not sure what the best approach should really be for this - thanks!