]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix bn_gcd code to check return value when calling BN_one()
authorslontis <shane.lontis@oracle.com>
Fri, 1 Jul 2022 03:47:11 +0000 (13:47 +1000)
committerRichard Levitte <levitte@openssl.org>
Tue, 5 Jul 2022 06:14:20 +0000 (08:14 +0200)
commit7fe7cc57af3db1e497877f0329ba17609b2efc8b
tree55546ba3387b73885c04427ff4db36cd0b554374
parent9ef1f848a646565d4dd86e56542cf921d4921ad9
Fix bn_gcd code to check return value when calling BN_one()

BN_one() uses the expand function which calls malloc which may fail.
All other places that reference BN_one() check the return value.

The issue is triggered by a memory allocation failure.
Detected by PR #18355

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18697)
crypto/bn/bn_gcd.c