diff --git a/gost/redhat.go b/gost/redhat.go index 40f73207..17bd1d84 100644 --- a/gost/redhat.go +++ b/gost/redhat.go @@ -108,7 +108,15 @@ func (red RedHat) fillUnfixed(driver db.DB, r *models.ScanResult) (nCVEs int, er cveCont := red.ConvertToModel(&cve) v, ok := r.ScannedCves[cve.Name] if ok { - v.CveContents[models.RedHatAPI] = *cveCont + if _, ok := v.CveContents[models.RedHatAPI]; ok { + v.CveContents[models.RedHatAPI] = *cveCont + } else { + v = models.VulnInfo{ + CveID: cveCont.CveID, + CveContents: models.NewCveContents(*cveCont), + Confidences: models.Confidences{models.RedHatAPIMatch}, + } + } } else { v = models.VulnInfo{ CveID: cveCont.CveID, @@ -138,7 +146,15 @@ func (red RedHat) fillUnfixed(driver db.DB, r *models.ScanResult) (nCVEs int, er cveCont := red.ConvertToModel(&cve) v, ok := r.ScannedCves[cve.Name] if ok { - v.CveContents[models.RedHatAPI] = *cveCont + if _, ok := v.CveContents[models.RedHatAPI]; ok { + v.CveContents[models.RedHatAPI] = *cveCont + } else { + v = models.VulnInfo{ + CveID: cveCont.CveID, + CveContents: models.NewCveContents(*cveCont), + Confidences: models.Confidences{models.RedHatAPIMatch}, + } + } } else { v = models.VulnInfo{ CveID: cveCont.CveID,