From 76037cdf72d22aefca95c1ae1d85323d2f29effa Mon Sep 17 00:00:00 2001 From: sadayuki-matsuno Date: Thu, 15 Nov 2018 13:43:06 +0900 Subject: [PATCH] fix new cve contents (#735) --- gost/debian.go | 6 +++++- gost/microsoft.go | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gost/debian.go b/gost/debian.go index 6e3f7c32..1b5b3a85 100644 --- a/gost/debian.go +++ b/gost/debian.go @@ -115,7 +115,11 @@ func (deb Debian) FillWithGost(driver db.DB, r *models.ScanResult) (nCVEs int, e for _, cve := range p.cves { v, ok := r.ScannedCves[cve.CveID] if ok { - v.CveContents[models.DebianSecurityTracker] = cve + if v.CveContents == nil { + v.CveContents = models.NewCveContents(cve) + } else { + v.CveContents[models.DebianSecurityTracker] = cve + } } else { v = models.VulnInfo{ CveID: cve.CveID, diff --git a/gost/microsoft.go b/gost/microsoft.go index 487d3fec..03858c6e 100644 --- a/gost/microsoft.go +++ b/gost/microsoft.go @@ -45,6 +45,9 @@ func (ms Microsoft) FillWithGost(driver db.DB, r *models.ScanResult) (nCVEs int, } cveCont := ms.ConvertToModel(&msCve) v, _ := r.ScannedCves[cveID] + if v.CveContents == nil { + v.CveContents = models.CveContents{} + } v.CveContents[models.Microsoft] = *cveCont r.ScannedCves[cveID] = v }