Skip to content

Commit

Permalink
golang: avoid false positive in fuzzer (#12916)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamKorcz authored Jan 7, 2025
1 parent e2046df commit 82970a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion projects/golang/ecdsa_fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ func FuzzEcdsaSign(data []byte) int {
return 0
}
randReader := bytes.NewReader(data[:firstRandReaderLen])
priv, _ := ecdsa.GenerateKey(c[cIndex], randReader)
priv, err := ecdsa.GenerateKey(c[cIndex], randReader)
if err != nil {
return 0
}
_, _, _ = ecdsa.Sign(randReader, priv, data[firstRandReaderLen+1:])
return 1
}

0 comments on commit 82970a4

Please sign in to comment.