]> code.ossystems Code Review - openembedded-core.git/commit
cve-check: fetch CVE data once at a time instead of in a single call
authorRoss Burton <ross.burton@intel.com>
Sun, 24 Nov 2019 23:50:15 +0000 (15:50 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 25 Nov 2019 21:37:01 +0000 (21:37 +0000)
commit3ded9a64c95ae02df7562fc69e2af08c150d2452
treedf229eed1de31ad8f5d1f15e79a4382302af9b0d
parent98162c04c877925c737674a1635b08cf998b92f5
cve-check: fetch CVE data once at a time instead of in a single call

This code used to construct a single SQL statement that fetched the NVD data for
every CVE requested.  For recipes such as the kernel where there are over 2000
CVEs to report this can hit the variable count limit and the query fails with
"sqlite3.OperationalError: too many SQL variables".  The default limit is 999
variables, but some distributions such as Debian set the default to 250000.

As the NVD table has an index on the ID column, whilst requesting the data
CVE-by-CVE is five times slower when working with 2000 CVEs the absolute time
different is insignificant: 0.05s verses 0.01s on my machine.

(From OE-Core rev: 53d0cc1e9b7190fa66d7ff1c59518f91b0128d99)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/cve-check.bbclass