From de850a6752bb1646d282589824a268e498e86ca2 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Mon, 11 Sep 2023 17:05:06 +0200 Subject: [PATCH] fix: fix products with no identified vulnerabilities (#3300) Products with no identified vulnerabilities are broken since commit 6b0f36e03b74abc76cd2b83a0d3207c4ceaa4d02 because products_with_cves will always contain a dictionnary of all products. So replace the broken lamba function with a more clear way of computing products with CVEs (i.e. len(cve_data["cves"])) Signed-off-by: Fabrice Fontaine --- cve_bin_tool/output_engine/console.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cve_bin_tool/output_engine/console.py b/cve_bin_tool/output_engine/console.py index d9bcc20a75..b418b2ab49 100644 --- a/cve_bin_tool/output_engine/console.py +++ b/cve_bin_tool/output_engine/console.py @@ -304,7 +304,11 @@ def validate_cell_length(cell_name, cell_type): table.add_column("Product") table.add_column("Version") - products_with_cves = list(map(lambda x: x[1], all_cve_data)) + products_with_cves = [] + for product_info, cve_data in all_cve_data.items(): + if len(cve_data["cves"]): + products_with_cves.append(product_info.product) + for product_data in all_product_data: if ( all_product_data[product_data] == 0