summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorColin McAllister <colinmca242@gmail.com>2024-12-30 19:22:23 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-01-08 13:25:11 +0000
commitdb2146dbe6a701e8eb225607aa6b8196273bc552 (patch)
treed5a44375453b7b714471fcd1b31f53d9ff2d20f4 /meta/lib
parent7f9b94a8a29bb3c173e90c0f702d7b752085b5a4 (diff)
downloadpoky-db2146dbe6a701e8eb225607aa6b8196273bc552.tar.gz
cve-check: Fix errors in log lines
Two warning lines in cve_check.py reference a variable that doesn't exist. These would cause a runtime error if the conditions they are hidden in were to be entered. The log lines have been updated to no longer reference an undefined variable. (From OE-Core rev: c9d059e8a362b3c9d604f7ebe8fd1dd994f0af6b) Signed-off-by: Colin McAllister <colinmca242@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/cve_check.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/meta/lib/oe/cve_check.py b/meta/lib/oe/cve_check.py
index 647a94f5af..280f9f613d 100644
--- a/meta/lib/oe/cve_check.py
+++ b/meta/lib/oe/cve_check.py
@@ -253,7 +253,10 @@ def decode_cve_status(d, cve):
253 description = status_split[4].strip() 253 description = status_split[4].strip()
254 elif len(status_split) >= 2 and status_split[1].strip() == "cpe": 254 elif len(status_split) >= 2 and status_split[1].strip() == "cpe":
255 # Malformed CPE 255 # Malformed CPE
256 bb.warn('Invalid CPE information for CVE_STATUS[%s] = "%s", not setting CPE' % (detail, cve, status)) 256 bb.warn(
257 'Invalid CPE information for CVE_STATUS[%s] = "%s", not setting CPE'
258 % (cve, status)
259 )
257 else: 260 else:
258 # Other case: no CPE, the syntax is then: 261 # Other case: no CPE, the syntax is then:
259 # detail: description 262 # detail: description
@@ -263,9 +266,13 @@ def decode_cve_status(d, cve):
263 status_out["product"] = product 266 status_out["product"] = product
264 status_out["description"] = description 267 status_out["description"] = description
265 268
266 status_mapping = d.getVarFlag("CVE_CHECK_STATUSMAP", status_out['detail']) 269 detail = status_out["detail"]
270 status_mapping = d.getVarFlag("CVE_CHECK_STATUSMAP", detail)
267 if status_mapping is None: 271 if status_mapping is None:
268 bb.warn('Invalid detail "%s" for CVE_STATUS[%s] = "%s", fallback to Unpatched' % (detail, cve, status)) 272 bb.warn(
273 'Invalid detail "%s" for CVE_STATUS[%s] = "%s", fallback to Unpatched'
274 % (detail, cve, status)
275 )
269 status_mapping = "Unpatched" 276 status_mapping = "Unpatched"
270 status_out["mapping"] = status_mapping 277 status_out["mapping"] = status_mapping
271 278