fix(libscan): include a lockfile path of libs (#1012)

This commit is contained in:
Kota Kanbe
2020-06-24 10:46:00 +09:00
committed by GitHub
parent 8a611f9ba6
commit c11ba27509
8 changed files with 115 additions and 120 deletions

View File

@@ -46,7 +46,12 @@ func FillLibrary(r *models.ScanResult) (totalCnt int, err error) {
}
for _, vinfo := range vinfos {
vinfo.Confidences.AppendIfMissing(models.TrivyMatch)
r.ScannedCves[vinfo.CveID] = vinfo
if v, ok := r.ScannedCves[vinfo.CveID]; !ok {
r.ScannedCves[vinfo.CveID] = vinfo
} else {
v.LibraryFixedIns = append(v.LibraryFixedIns, vinfo.LibraryFixedIns...)
r.ScannedCves[vinfo.CveID] = v
}
}
totalCnt += len(vinfos)
}