Skip to content

Commit

Permalink
Remove the preallocation of signatures slice. (#869)
Browse files Browse the repository at this point in the history
This was making codeql upset. I don't think there's a real issue, but better safe
than sorry.

Signed-off-by: Dan Lorenc <lorenc.d@gmail.com>
  • Loading branch information
dlorenc committed Oct 11, 2021
1 parent 2ba1605 commit cc4ce1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cosign/tuf/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (s *Signed) AddOrUpdateSignature(signature Signature) error {
if !root.ValidKey(signature.KeyID, "root") {
return errors.New("invalid root key")
}
signatures := make([]Signature, 0, len(s.Signatures)+1)
signatures := []Signature{}
for _, sig := range s.Signatures {
if sig.KeyID != signature.KeyID {
signatures = append(signatures, sig)
Expand Down

0 comments on commit cc4ce1b

Please sign in to comment.