Browse Source

Check solution length in validate challenge

Found by Fuzz Bot.
bugfix
Sarah Jamie Lewis 1 year ago
parent
commit
770f36afad
  1. 3
      applications/proof_of_work_app.go

3
applications/proof_of_work_app.go

@ -87,6 +87,9 @@ func (powapp *ProofOfWorkApplication) solveChallenge(challenge []byte, prng core
// ValidateChallenge returns true if the message and spamguard pass the challenge
func (powapp *ProofOfWorkApplication) validateChallenge(challenge []byte, solution []byte) bool {
if len(solution) != 32 {
return false
}
solve := make([]byte, len(challenge)+32)
copy(solve[0:], solution[0:32])
copy(solve[32:], challenge[:])

Loading…
Cancel
Save