fix(gost) sort in ms converter (#1293)

This commit is contained in:
sadayuki-matsuno
2021-08-26 14:32:45 +09:00
committed by GitHub
parent 1003f62212
commit 7e71cbdd46

View File

@@ -4,6 +4,7 @@
package gost
import (
"sort"
"strings"
"github.com/future-architect/vuls/models"
@@ -42,6 +43,9 @@ func (ms Microsoft) DetectCVEs(r *models.ScanResult, _ bool) (nCVEs int, err err
// ConvertToModel converts gost model to vuls model
func (ms Microsoft) ConvertToModel(cve *gostmodels.MicrosoftCVE) (*models.CveContent, []models.Mitigation) {
sort.Slice(cve.ScoreSets, func(i, j int) bool {
return cve.ScoreSets[i].Vector < cve.ScoreSets[j].Vector
})
v3score := 0.0
var v3Vector string
for _, scoreSet := range cve.ScoreSets {