diff options
author | Matt Caswell <matt@openssl.org> | 2018-06-26 15:12:56 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2018-07-07 14:00:19 +0100 |
commit | bdd92f4d9bce6c62e553f89a2556c6881fc6d5dd (patch) | |
tree | 9c9c2bb0a23b75e5ccaeb1790dc48c301edc2890 /crypto | |
parent | 1829ff4b5e7f1d1570ea9b9e4660a1a673e5da67 (diff) |
Check a return value for success in ec_field_size()
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6592)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/sm2/sm2_crypt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/sm2/sm2_crypt.c b/crypto/sm2/sm2_crypt.c index f2470609f9..aedf9054c1 100644 --- a/crypto/sm2/sm2_crypt.c +++ b/crypto/sm2/sm2_crypt.c @@ -48,7 +48,8 @@ static size_t ec_field_size(const EC_GROUP *group) if (p == NULL || a == NULL || b == NULL) goto done; - EC_GROUP_get_curve_GFp(group, p, a, b, NULL); + if (!EC_GROUP_get_curve_GFp(group, p, a, b, NULL)) + goto done; field_size = (BN_num_bits(p) + 7) / 8; done: |