From 426511d07fd4f0c9e7ead5b70a6b391064be55be Mon Sep 17 00:00:00 2001 From: ndossche Date: Thu, 12 Feb 2026 17:00:41 +0100 Subject: [PATCH] fix: add null check to BIOPointer::New() This function calls BIO_new() which mustn't receive a null pointer argument. Yet it is able to handle null BIOs gracefully. To solve this, add a null check. Ref: https://github.com/nodejs/node/pull/61788 --- src/ncrypto.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ncrypto.cpp b/src/ncrypto.cpp index e935eb8..50bd9c0 100644 --- a/src/ncrypto.cpp +++ b/src/ncrypto.cpp @@ -1515,6 +1515,7 @@ BIOPointer BIOPointer::NewSecMem() { } BIOPointer BIOPointer::New(const BIO_METHOD* method) { + if (method == nullptr) return {}; return BIOPointer(BIO_new(method)); }