mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-05 20:40:16 -08:00
fix(redhat): always use vulns with fixed version if there is one (#2165)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
@@ -159,7 +159,11 @@ func (s *Scanner) detect(osVer string, pkg ftypes.Package) ([]types.DetectedVuln
|
||||
|
||||
// unpatched vulnerabilities
|
||||
if adv.FixedVersion == "" {
|
||||
uniqVulns[vulnID] = vuln
|
||||
// Red Hat may contain several advisories for the same vulnerability (RHSA advisories).
|
||||
// To avoid overwriting the fixed version by mistake, we should skip unpatched vulnerabilities if they were added earlier
|
||||
if _, ok := uniqVulns[vulnID]; !ok {
|
||||
uniqVulns[vulnID] = vuln
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user