diff options
Diffstat (limited to 'crypto/sm2')
-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: |