]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
improve_kernel_cve_report: validate that cve details field exists
authorDaniel Turull <daniel.turull@ericsson.com>
Wed, 4 Feb 2026 13:42:35 +0000 (14:42 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 5 Mar 2026 11:18:56 +0000 (11:18 +0000)
Check if the cve information has the details field to avoid crashing

Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/contrib/improve_kernel_cve_report.py

index 903de0000cbf5aea29169e46e1d5a509d4781712..b386c9383a7b3416d95caca41e4f0c1fb0f7b912 100755 (executable)
@@ -363,7 +363,7 @@ def cve_update(cve_data, cve, entry):
     if entry['status'] == "Unpatched" and cve_data[cve]['status'] == "Patched":
         # Backported-patch (e.g. vendor kernel repo with cherry-picked CVE patch)
         # has priority over unpatch from CNA
-        if cve_data[cve]['detail'] == "backported-patch":
+        if "detail" in cve_data and cve_data[cve]['detail'] == "backported-patch":
             return
         logging.warning("CVE entry %s update from Patched to Unpatched from the scan result", cve)
         cve_data[cve] = copy_data(cve_data[cve], entry)