Skip to content

Commit

Permalink
Check a return value for success in ec_field_size()
Browse files Browse the repository at this point in the history
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from #6592)
  • Loading branch information
mattcaswell committed Jul 7, 2018
1 parent 1829ff4 commit bdd92f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crypto/sm2/sm2_crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit bdd92f4

Please sign in to comment.