Update buildroot to 2021.02.2 (#1370)
This commit is contained in:
@@ -28,6 +28,12 @@ import operator
|
||||
|
||||
try:
|
||||
import ijson
|
||||
# backend is a module in < 2.5, a string in >= 2.5
|
||||
if 'python' in getattr(ijson.backend, '__name__', ijson.backend):
|
||||
try:
|
||||
import ijson.backends.yajl2_cffi as ijson
|
||||
except ImportError:
|
||||
sys.stderr.write('Warning: Using slow ijson python backend\n')
|
||||
except ImportError:
|
||||
sys.stderr.write("You need ijson to parse NVD for CVE check\n")
|
||||
exit(1)
|
||||
@@ -223,6 +229,11 @@ class CVE:
|
||||
# if we don't have a cpeid, build one based on name and version
|
||||
if not cpeid:
|
||||
cpeid = "cpe:2.3:*:*:%s:%s:*:*:*:*:*:*:*" % (name, version)
|
||||
# if we have a cpeid, use its version instead of the package
|
||||
# version, as they might be different due to
|
||||
# <pkg>_CPE_ID_VERSION
|
||||
else:
|
||||
pkg_version = distutils.version.LooseVersion(cpe_version(cpeid))
|
||||
|
||||
for cpe in self.each_cpe():
|
||||
if not cpe_matches(cpe['id'], cpeid):
|
||||
|
||||
Reference in New Issue
Block a user