Check solution length in validate challenge
Found by Fuzz Bot.
This commit is contained in:
parent
7444d1e0cf
commit
770f36afad
|
@ -87,6 +87,9 @@ func (powapp *ProofOfWorkApplication) solveChallenge(challenge []byte, prng core
|
||||||
|
|
||||||
// ValidateChallenge returns true if the message and spamguard pass the challenge
|
// ValidateChallenge returns true if the message and spamguard pass the challenge
|
||||||
func (powapp *ProofOfWorkApplication) validateChallenge(challenge []byte, solution []byte) bool {
|
func (powapp *ProofOfWorkApplication) validateChallenge(challenge []byte, solution []byte) bool {
|
||||||
|
if len(solution) != 32 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
solve := make([]byte, len(challenge)+32)
|
solve := make([]byte, len(challenge)+32)
|
||||||
copy(solve[0:], solution[0:32])
|
copy(solve[0:], solution[0:32])
|
||||||
copy(solve[32:], challenge[:])
|
copy(solve[32:], challenge[:])
|
||||||
|
|
Loading…
Reference in New Issue