From f4b64d973d0187d94a3115c5b3ffc606c69d7ba0 Mon Sep 17 00:00:00 2001 From: tb Date: Sat, 11 May 2024 18:52:52 +0000 Subject: [PATCH] Make two NULL checks more explicit --- lib/libcrypto/x509/x509_lib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libcrypto/x509/x509_lib.c b/lib/libcrypto/x509/x509_lib.c index 1772692f2bd..45ed9405fdc 100644 --- a/lib/libcrypto/x509/x509_lib.c +++ b/lib/libcrypto/x509/x509_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_lib.c,v 1.18 2024/05/11 18:48:47 tb Exp $ */ +/* $OpenBSD: x509_lib.c,v 1.19 2024/05/11 18:52:52 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -176,10 +176,10 @@ X509V3_EXT_d2i(X509_EXTENSION *ext) const X509V3_EXT_METHOD *method; const unsigned char *p; - if (!(method = X509V3_EXT_get(ext))) + if ((method = X509V3_EXT_get(ext)) == NULL) return NULL; p = ext->value->data; - if (method->it) + if (method->it != NULL) return ASN1_item_d2i(NULL, &p, ext->value->length, method->it); return method->d2i(NULL, &p, ext->value->length); } -- 2.20.1