From e52d8630bbe21af8a646605f68c47c4cf2cde369 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 23 Apr 2023 11:34:57 +0000 Subject: Add missing NULL check for BN_new() --- src/lib/libcrypto/x509/x509_utl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/x509/x509_utl.c b/src/lib/libcrypto/x509/x509_utl.c index f7b9c8586d..51c3135bbe 100644 --- a/src/lib/libcrypto/x509/x509_utl.c +++ b/src/lib/libcrypto/x509/x509_utl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_utl.c,v 1.11 2023/04/23 11:25:21 tb Exp $ */ +/* $OpenBSD: x509_utl.c,v 1.12 2023/04/23 11:34:57 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -248,7 +248,10 @@ s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, const char *value) X509V3error(X509V3_R_INVALID_NULL_VALUE); return NULL; } - bn = BN_new(); + if ((bn = BN_new()) == NULL) { + X509V3error(ERR_R_MALLOC_FAILURE); + return NULL; + } if (value[0] == '-') { value++; isneg = 1; -- cgit v1.2.3-55-g6feb