From 1954ef164a55cbc4369f513cca3fb43f3550d81a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 8 Mar 2021 11:54:33 -0500 Subject: Minor OpenSSL fixes These are all the NULL pointer dereferences (which all appear to be, at worst, very difficult to hit) that gcc -fanalyzer finds in our OpenSSL code. Signed-off-by: Peter Jones --- Cryptlib/OpenSSL/crypto/bn/bn_lib.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Cryptlib/OpenSSL/crypto/bn/bn_lib.c') diff --git a/Cryptlib/OpenSSL/crypto/bn/bn_lib.c b/Cryptlib/OpenSSL/crypto/bn/bn_lib.c index 10b78f51..2671f35c 100644 --- a/Cryptlib/OpenSSL/crypto/bn/bn_lib.c +++ b/Cryptlib/OpenSSL/crypto/bn/bn_lib.c @@ -496,6 +496,9 @@ BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) if (bn_wexpand(a, b->top) == NULL) return (NULL); + if (!a || !b || !a->d || !b->d) + return (NULL); + #if 1 A = a->d; B = b->d; -- cgit v1.2.3