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/asn1/t_req.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Cryptlib/OpenSSL/crypto/asn1/t_req.c') diff --git a/Cryptlib/OpenSSL/crypto/asn1/t_req.c b/Cryptlib/OpenSSL/crypto/asn1/t_req.c index 70aba4cc..c32241c2 100644 --- a/Cryptlib/OpenSSL/crypto/asn1/t_req.c +++ b/Cryptlib/OpenSSL/crypto/asn1/t_req.c @@ -195,10 +195,11 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags, goto err; if (BIO_puts(bp, ":") <= 0) goto err; - if ((type == V_ASN1_PRINTABLESTRING) || + if (bs != NULL && ( + (type == V_ASN1_PRINTABLESTRING) || (type == V_ASN1_UTF8STRING) || (type == V_ASN1_T61STRING) || - (type == V_ASN1_IA5STRING)) { + (type == V_ASN1_IA5STRING))) { if (BIO_write(bp, (char *)bs->data, bs->length) != bs->length) goto err; -- cgit v1.2.3