summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2020-11-24 12:57:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-12-18 14:20:19 +0000
commit9e038fd7f74462619b4e81fd52c5f09908c4c3da (patch)
tree07dc45c418a75189ab63199d7e4fee5afe4f0a62 /meta/recipes-core
parenta71a0ed31aa81678b4e08811d0bd54e01533bf44 (diff)
downloadpoky-9e038fd7f74462619b4e81fd52c5f09908c4c3da.tar.gz
cve-update-db-native: handle all-wildcard versions
If a CPE version field is just *:*:*:* it should be handled the same as -:*:*:*, that is 'all versions'. To ease handling, transform this case to use -. (From OE-Core rev: ff17ef98ff7ff0bfac9f647c0833f5b7b6d6fdd6) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 04a9bc4ca5294fe6834513669c7746a824d12b04) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/meta/cve-update-db-native.bb7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/recipes-core/meta/cve-update-db-native.bb b/meta/recipes-core/meta/cve-update-db-native.bb
index 0cd3a1c153..9e8e006a32 100644
--- a/meta/recipes-core/meta/cve-update-db-native.bb
+++ b/meta/recipes-core/meta/cve-update-db-native.bb
@@ -166,7 +166,12 @@ def parse_node_and_insert(c, node, cveId):
166 op_end = '<' 166 op_end = '<'
167 v_end = cpe['versionEndExcluding'] 167 v_end = cpe['versionEndExcluding']
168 168
169 yield [cveId, vendor, product, v_start, op_start, v_end, op_end] 169 if op_start or op_end or v_start or v_end:
170 yield [cveId, vendor, product, v_start, op_start, v_end, op_end]
171 else:
172 # This is no version information, expressed differently.
173 # Save processing by representing as -.
174 yield [cveId, vendor, product, '-', '', '', '']
170 175
171 c.executemany("insert into PRODUCTS values (?, ?, ?, ?, ?, ?, ?)", cpe_generator()) 176 c.executemany("insert into PRODUCTS values (?, ?, ?, ?, ?, ?, ?)", cpe_generator())
172 177