Skip to content

Commit

Permalink
Fix vuln. source name dereference if source nil
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Rutkowski <[email protected]>
  • Loading branch information
mrutkows committed Nov 7, 2024
1 parent b538cf9 commit 50685e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ In this example, the `--from` filter will return the entire JSON components arra
]
```

**Note**: The command for this example only used the `--from` flag and did not need to supply `--select '*'` as this us the default.
**Note**: The command for this example only used the `--from` flag and did not need to supply `--select '*'` as this is the default.

##### Example: Filter result entries with a specified value

Expand Down
2 changes: 1 addition & 1 deletion schema/bom_hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ func (bom *BOM) HashmapVulnerability(cdxVulnerability CDXVulnerability, whereFil
// defer to same source as the top-level vuln. declares
fSeverity := fmt.Sprintf("%s: %v (%s)", rating.Method, rating.Score, rating.Severity)
// give listing priority to ratings that matches top-level vuln. reporting source
if rating.Source.Name == cdxVulnerability.Source.Name {
if rating.Source != nil && rating.Source.Name == cdxVulnerability.Source.Name {
// prepend to slice
vulnInfo.CvssSeverity = append([]string{fSeverity}, vulnInfo.CvssSeverity...)
continue
Expand Down

0 comments on commit 50685e8

Please sign in to comment.