diff --git a/.github/README.md b/.github/README.md index fe0ceba2..2467622c 100644 --- a/.github/README.md +++ b/.github/README.md @@ -113,8 +113,7 @@ opensca-cli -db db.json -path ${project_path} "release_date": "2021-12-10", "security_level_id": 1, "exploit_level_id": 1 - }, - {} + } ] ``` diff --git a/README.md b/README.md index 16c22ac9..688688b7 100644 --- a/README.md +++ b/README.md @@ -112,8 +112,7 @@ opensca-cli -db db.json -path ${project_path} "release_date": "2021-12-10", "security_level_id": 1, "exploit_level_id": 1 - }, - {} + } ] ``` diff --git a/util/vuln/local.go b/util/vuln/local.go index 90d62f80..68ce53ad 100644 --- a/util/vuln/local.go +++ b/util/vuln/local.go @@ -36,8 +36,14 @@ func loadVulnDB() { } else { // 解析本地漏洞 db := []vulnInfo{} - json.Unmarshal(data, &db) + err := json.Unmarshal(data, &db) + if err != nil { + logs.Error(err) + } for _, info := range db { + if info.Vuln == nil { + continue + } // 有中文描述则省略英文描述 if info.Description != "" { info.DescriptionEn = ""