Skip to content

Commit

Permalink
fix: java parser failing to match vendor on product without '-'
Browse files Browse the repository at this point in the history
if the product did not have - in name and the vendor was found
it would return None even though the match was found

* fixes intel#2960

Signed-off-by: Bartlomiej Cieszkowski <[email protected]>
  • Loading branch information
bcieszko committed May 18, 2023
1 parent 92d27dc commit 3e6de25
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions cve_bin_tool/parsers/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@ def find_vendor(self, product, version):
product = product.replace("-parent", "")
product = product.replace("-", "_")
vendor_package_pair = self.cve_db.get_vendor_product_pairs(product)
if vendor_package_pair != []:
info = []
for pair in vendor_package_pair:
vendor = pair["vendor"]
file_path = self.filename
self.logger.debug(f"{file_path} {product} {version} by {vendor}")
info.append(
ScanInfo(ProductInfo(vendor, product, version), file_path)
)
return info
if vendor_package_pair != []:
info = []
for pair in vendor_package_pair:
vendor = pair["vendor"]
file_path = self.filename
self.logger.debug(f"{file_path} {product} {version} by {vendor}")
info.append(ScanInfo(ProductInfo(vendor, product, version), file_path))
return info
return None

def run_checker(self, filename):
Expand Down

0 comments on commit 3e6de25

Please sign in to comment.