diff options
author | Hugo Landau <hlandau@openssl.org> | 2022-04-04 12:25:16 +0100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-04-07 10:37:03 +1000 |
commit | bed08d615f24b88eea4f64e1454890543277d2b0 (patch) | |
tree | 6a0ef34e4f29755393aab697b27e459990b50f53 /crypto/bn | |
parent | 0f8cad80150d1fcb762394b4ec6a352455505369 (diff) |
Fix failure to check result of bn_rshift_fixed_top
Fixes #18010.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18034)
(cherry picked from commit bc6bac8561ead83d6135f376ffcbbb0b657e64fe)
Diffstat (limited to 'crypto/bn')
-rw-r--r-- | crypto/bn/bn_div.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/bn/bn_div.c b/crypto/bn/bn_div.c index 25514c05f1..ec6c532e4e 100644 --- a/crypto/bn/bn_div.c +++ b/crypto/bn/bn_div.c @@ -446,8 +446,10 @@ int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, snum->neg = num_neg; snum->top = div_n; snum->flags |= BN_FLG_FIXED_TOP; - if (rm != NULL) - bn_rshift_fixed_top(rm, snum, norm_shift); + + if (rm != NULL && bn_rshift_fixed_top(rm, snum, norm_shift) == 0) + goto err; + BN_CTX_end(ctx); return 1; err: |