From: Thomas Petazzoni Date: Mon, 12 Apr 2021 19:41:25 +0000 (+0200) Subject: support/scripts/cve.py: use proper CPE ID version when available X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d06bf960977a95df9e6da9523ffbbd93fa7f920c;p=buildroot.git support/scripts/cve.py: use proper CPE ID version when available Signed-off-by: Thomas Petazzoni --- diff --git a/support/scripts/cve.py b/support/scripts/cve.py index 965fc2a466..13c29fabe0 100755 --- a/support/scripts/cve.py +++ b/support/scripts/cve.py @@ -229,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 + # _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):