We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66c9bc6 commit 5758c09Copy full SHA for 5758c09
database/pgsql/rhelv2_vulnerability.go
@@ -10,6 +10,7 @@ import (
10
"context"
11
"crypto/md5"
12
"database/sql"
13
+ "sort"
14
"time"
15
16
"github.com/lib/pq"
@@ -216,6 +217,11 @@ func (pgSQL *pgSQL) GetRHELv2Vulnerabilities(records []*database.RHELv2Record) (
216
217
218
addedVulns := uniqueVulns[recordID]
219
220
+ // Order the vulns in terms of updated first so that if we have multiple of the same vulns
221
+ // the ones with the latest update time will be used
222
+ sort.SliceStable(matchedVulns, func(i, j int) bool {
223
+ return matchedVulns[i].Updated.After(matchedVulns[j].Updated)
224
+ })
225
for _, matched := range matchedVulns {
226
if addedVulns.Add(matched.Name) {
227
vulnMap[recordID] = append(vulnMap[recordID], matched)
0 commit comments