diff options
author | Ross Burton <ross@burtonini.com> | 2020-11-24 12:57:24 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-11-29 20:23:15 +0000 |
commit | 04a9bc4ca5294fe6834513669c7746a824d12b04 (patch) | |
tree | b38b993f2dac5895c5669fabe2ae9b275000e820 /meta/recipes-core/meta | |
parent | 6e3785a3f1f3cf68f5fe101cd6bebe91db165973 (diff) | |
download | openembedded-core-contrib-04a9bc4ca5294fe6834513669c7746a824d12b04.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 -.
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/meta')
-rw-r--r-- | meta/recipes-core/meta/cve-update-db-native.bb | 7 |
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 cf2b251e21..cf62e1e32c 100644 --- a/meta/recipes-core/meta/cve-update-db-native.bb +++ b/meta/recipes-core/meta/cve-update-db-native.bb @@ -172,7 +172,12 @@ def parse_node_and_insert(c, node, cveId): op_end = '<' v_end = cpe['versionEndExcluding'] - yield [cveId, vendor, product, v_start, op_start, v_end, op_end] + if op_start or op_end or v_start or v_end: + yield [cveId, vendor, product, v_start, op_start, v_end, op_end] + else: + # This is no version information, expressed differently. + # Save processing by representing as -. + yield [cveId, vendor, product, '-', '', '', ''] c.executemany("insert into PRODUCTS values (?, ?, ?, ?, ?, ?, ?)", cpe_generator()) |