Skip to content

Commit

Permalink
fix: nil pointer dereference during evidence conversion
Browse files Browse the repository at this point in the history
Signed-off-by: nscuro <nscuro@protonmail.com>
  • Loading branch information
nscuro committed Sep 14, 2024
1 parent 6f53207 commit 6f0e0cf
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,15 @@ func convertEvidence(c *Component, specVersion SpecVersion) {
}

if specVersion < SpecVersion1_6 {
for i := range *c.Evidence.Occurrences {
occ := &(*c.Evidence.Occurrences)[i]

occ.Line = nil
occ.Offset = nil
occ.Symbol = ""
occ.AdditionalContext = ""
if c.Evidence.Occurrences != nil {
for i := range *c.Evidence.Occurrences {
occ := &(*c.Evidence.Occurrences)[i]

occ.Line = nil
occ.Offset = nil
occ.Symbol = ""
occ.AdditionalContext = ""
}
}
}

Expand Down

0 comments on commit 6f0e0cf

Please sign in to comment.