Skip to content

Commit

Permalink
bugfix (#36)
Browse files Browse the repository at this point in the history
* 使用本地漏洞库时报空指针错误

* Update vuln samples in readme

* Update vuln samples in readme

Co-authored-by: huyongfeng <[email protected]>
  • Loading branch information
itxiaohu001 and huyongfeng authored Jan 17, 2023
1 parent ff0ab0e commit 7e7eec3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
{}
}
]
```

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
{}
}
]
```

Expand Down
8 changes: 7 additions & 1 deletion util/vuln/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down

0 comments on commit 7e7eec3

Please sign in to comment.