Skip to content

Commit

Permalink
Bug: nonjson: Ensure software id has a length of 1 byte
Browse files Browse the repository at this point in the history
  • Loading branch information
zsrv committed Feb 14, 2023
1 parent 1a527c8 commit ea08419
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/nonjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ var nonjsonEncodeCmd = &cobra.Command{
pk.SoftwareIdentifier = *swid
swidSet = true
case len(swID) > 0:
if len(swID) != 1 {
return errors.New("software id must have a length of 1 byte")
}

swid, err := nonjson.SoftwareIdentifiers.ByID(swID[0])
if err != nil {
return err
Expand Down

0 comments on commit ea08419

Please sign in to comment.