Make signing fail if a too small buffer is passed.

Bug discovered by Sergio Demian Lerner.
This commit is contained in:
Pieter Wuille
2014-12-18 01:28:06 +01:00
parent 6d1660663f
commit 603c33bc80
2 changed files with 3 additions and 1 deletions

View File

@@ -88,7 +88,7 @@ int secp256k1_ecdsa_sign(const unsigned char *msg32, unsigned char *signature, i
ret = secp256k1_ecdsa_sig_sign(&sig, &sec, &msg, &non, NULL);
}
if (ret) {
secp256k1_ecdsa_sig_serialize(signature, signaturelen, &sig);
ret = secp256k1_ecdsa_sig_serialize(signature, signaturelen, &sig);
}
secp256k1_scalar_clear(&msg);
secp256k1_scalar_clear(&non);