From 2fc2432923201030758979754629f0e86437bcf4 Mon Sep 17 00:00:00 2001 From: Shubham Mittal Date: Thu, 31 Oct 2024 19:04:55 -0700 Subject: [PATCH] null check --- crypto/x509/v3_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/x509/v3_lib.c b/crypto/x509/v3_lib.c index 6b12975761..322a210af5 100644 --- a/crypto/x509/v3_lib.c +++ b/crypto/x509/v3_lib.c @@ -150,7 +150,7 @@ const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid) { const X509V3_EXT_METHOD *X509V3_EXT_get(const X509_EXTENSION *ext) { int nid; - if ((nid = OBJ_obj2nid(ext->object)) == NID_undef) { + if (ext == NULL || (nid = OBJ_obj2nid(ext->object)) == NID_undef) { return NULL; } return X509V3_EXT_get_nid(nid);