Avoid uninitialized access in secp256k1_gej_double

This commit is contained in:
Pieter Wuille 2014-10-26 06:50:21 -07:00
parent bff11e9112
commit 03bfc07b9e
No known key found for this signature in database
GPG Key ID: 57896D2FF8F0B657
1 changed files with 6 additions and 1 deletions

View File

@ -190,9 +190,14 @@ int static secp256k1_ge_is_valid(const secp256k1_ge_t *a) {
}
void static secp256k1_gej_double(secp256k1_gej_t *r, const secp256k1_gej_t *a) {
if (a->infinity) {
r->infinity = 1;
return;
}
secp256k1_fe_t t5 = a->y;
secp256k1_fe_normalize(&t5);
if (a->infinity || secp256k1_fe_is_zero(&t5)) {
if (secp256k1_fe_is_zero(&t5)) {
r->infinity = 1;
return;
}