mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 05:40:11 +01:00
dont use pointer for lists of elements
This commit is contained in:
parent
c8f1361c52
commit
37cdda7c42
1 changed files with 22 additions and 20 deletions
|
|
@ -756,20 +756,20 @@ type References []*Reference
|
|||
|
||||
// Vulnerability contains all fields that are related to a single vulnerability in the document.
|
||||
type Vulnerability struct {
|
||||
Acknowledgements *Acknowledgements `json:"acknowledgements,omitempty"`
|
||||
Acknowledgements Acknowledgements `json:"acknowledgements,omitempty"`
|
||||
CVE *CVE `json:"cve,omitempty"`
|
||||
CWE *CWE `json:"cwe,omitempty"`
|
||||
DiscoveryDate *string `json:"discovery_date,omitempty"`
|
||||
Flags *Flags `json:"flags,omitempty"`
|
||||
IDs *VulnerabilityIDs `json:"ids,omitempty"` // unique ID elements
|
||||
Involvements *Involvements `json:"involvements,omitempty"`
|
||||
Flags Flags `json:"flags,omitempty"`
|
||||
IDs VulnerabilityIDs `json:"ids,omitempty"` // unique ID elements
|
||||
Involvements Involvements `json:"involvements,omitempty"`
|
||||
Notes Notes `json:"notes,omitempty"`
|
||||
ProductStatus *ProductStatus `json:"product_status,omitempty"`
|
||||
References References `json:"references,omitempty"`
|
||||
ReleaseDate *string `json:"release_date,omitempty"`
|
||||
Remediations *Remediations `json:"remediations,omitempty"`
|
||||
Scores *Scores `json:"scores,omitempty"`
|
||||
Threats *Threats `json:"threats,omitempty"`
|
||||
Remediations Remediations `json:"remediations,omitempty"`
|
||||
Scores Scores `json:"scores,omitempty"`
|
||||
Threats Threats `json:"threats,omitempty"`
|
||||
Title *string `json:"title,omitempty"`
|
||||
}
|
||||
|
||||
|
|
@ -780,7 +780,7 @@ type Vulnerabilities []*Vulnerability
|
|||
type Advisory struct {
|
||||
Document *Document `json:"document"` // required
|
||||
ProductTree *ProductTree `json:"product_tree,omitempty"`
|
||||
Vulnerabilities *Vulnerabilities `json:"vulnerabilities,omitempty"`
|
||||
Vulnerabilities Vulnerabilities `json:"vulnerabilities,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates a AggregateSeverity.
|
||||
|
|
@ -1375,9 +1375,11 @@ func (adv *Advisory) Validate() error {
|
|||
return fmt.Errorf("'product_tree' is invalid: %w", err)
|
||||
}
|
||||
}
|
||||
if adv.Vulnerabilities != nil {
|
||||
if err := adv.Vulnerabilities.Validate(); err != nil {
|
||||
return fmt.Errorf("'vulnerabilities' is invalid: %w", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue