refactor(report): around FillCveInfo (#1095)

* refactor(report): around FillCveInfo

* refacotr(report): around FillCveInfo
This commit is contained in:
Kota Kanbe
2020-12-15 15:48:23 +09:00
committed by GitHub
parent 514eb71482
commit d576b6c6c1
9 changed files with 172 additions and 104 deletions

View File

@@ -214,7 +214,7 @@ func httpGet(url string, req request, resChan chan<- response, errChan chan<- er
defs := []ovalmodels.Definition{}
if err := json.Unmarshal([]byte(body), &defs); err != nil {
errChan <- xerrors.Errorf("Failed to Unmarshall. body: %s, err: %w", body, err)
errChan <- xerrors.Errorf("Failed to Unmarshal. body: %s, err: %w", body, err)
return
}
resChan <- response{
@@ -278,6 +278,9 @@ func getDefsByPackNameFromOvalDB(driver db.DB, r *models.ScanResult) (relatedDef
}
func major(version string) string {
if version == "" {
return ""
}
ss := strings.SplitN(version, ":", 2)
ver := ""
if len(ss) == 1 {
@@ -336,7 +339,7 @@ func isOvalDefAffected(def ovalmodels.Definition, req request, family string, ru
}
// But CentOS can't judge whether fixed or unfixed.
// Because fixed state in RHEL's OVAL is different.
// Because fixed state in RHEL OVAL is different.
// So, it have to be judged version comparison.
// `offline` or `fast` scan mode can't get a updatable version.