From f47a0699a2b64adafd2ca7afa46c52c1119d3291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Fri, 18 Feb 2022 00:11:54 +0100 Subject: [PATCH] crypto: check result of BIO_new in X509ToObject Match other call sites of BIO_new(BIO_s_mem()) and CHECK the result of the call. Refs: https://github.com/nodejs/node/commit/fb3a9cd0d8e8cf5f3120012a28643230b31c1f83 PR-URL: https://github.com/nodejs/node/pull/41979 Reviewed-By: Anna Henningsen Reviewed-By: Antoine du Hamel --- src/crypto/crypto_common.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc index 2234cb151afcf7..97895f7c118d64 100644 --- a/src/crypto/crypto_common.cc +++ b/src/crypto/crypto_common.cc @@ -1351,6 +1351,7 @@ MaybeLocal X509ToObject( Local info = Object::New(env->isolate()); BIOPointer bio(BIO_new(BIO_s_mem())); + CHECK(bio); if (names_as_string) { // TODO(tniessen): this branch should not have to exist. It is only here