Skip to content

Commit 669d503

Browse files
committed
fix: java parser failing to match vendor on product without '-'
if the product did not have - in name and the vendor was found it would return None even though the match was found * fixes #2960 Signed-off-by: Bartlomiej Cieszkowski <[email protected]>
1 parent 95a48fd commit 669d503

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

cve_bin_tool/parsers/java.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ def find_vendor(self, product, version):
2626
product = product.replace("-parent", "")
2727
product = product.replace("-", "_")
2828
vendor_package_pair = self.cve_db.get_vendor_product_pairs(product)
29-
if vendor_package_pair != []:
30-
info = []
31-
for pair in vendor_package_pair:
32-
vendor = pair["vendor"]
33-
file_path = self.filename
34-
self.logger.debug(f"{file_path} {product} {version} by {vendor}")
35-
info.append(
36-
ScanInfo(ProductInfo(vendor, product, version), file_path)
37-
)
38-
return info
29+
if vendor_package_pair != []:
30+
info = []
31+
for pair in vendor_package_pair:
32+
vendor = pair["vendor"]
33+
file_path = self.filename
34+
self.logger.debug(f"{file_path} {product} {version} by {vendor}")
35+
info.append(
36+
ScanInfo(ProductInfo(vendor, product, version), file_path)
37+
)
38+
return info
3939
return None
4040

4141
def run_checker(self, filename):

0 commit comments

Comments
 (0)