summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/cve_check.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/cve_check.py')
-rw-r--r--meta/lib/oe/cve_check.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/meta/lib/oe/cve_check.py b/meta/lib/oe/cve_check.py
index 2efc4290af..65b1358ffc 100644
--- a/meta/lib/oe/cve_check.py
+++ b/meta/lib/oe/cve_check.py
@@ -89,11 +89,6 @@ def get_patched_cves(d):
89 for url in oe.patch.src_patches(d): 89 for url in oe.patch.src_patches(d):
90 patch_file = bb.fetch.decodeurl(url)[2] 90 patch_file = bb.fetch.decodeurl(url)[2]
91 91
92 # Remote compressed patches may not be unpacked, so silently ignore them
93 if not os.path.isfile(patch_file):
94 bb.warn("%s does not exist, cannot extract CVE list" % patch_file)
95 continue
96
97 # Check patch file name for CVE ID 92 # Check patch file name for CVE ID
98 fname_match = cve_file_name_match.search(patch_file) 93 fname_match = cve_file_name_match.search(patch_file)
99 if fname_match: 94 if fname_match:
@@ -101,6 +96,12 @@ def get_patched_cves(d):
101 patched_cves.add(cve) 96 patched_cves.add(cve)
102 bb.debug(2, "Found CVE %s from patch file name %s" % (cve, patch_file)) 97 bb.debug(2, "Found CVE %s from patch file name %s" % (cve, patch_file))
103 98
99 # Remote patches won't be present and compressed patches won't be
100 # unpacked, so say we're not scanning them
101 if not os.path.isfile(patch_file):
102 bb.note("%s is remote or compressed, not scanning content" % patch_file)
103 continue
104
104 with open(patch_file, "r", encoding="utf-8") as f: 105 with open(patch_file, "r", encoding="utf-8") as f:
105 try: 106 try:
106 patch_text = f.read() 107 patch_text = f.read()