From f3212f6849af40a72001f65554c2cf9a0bbc04c5 Mon Sep 17 00:00:00 2001 From: Burkov Egor Date: Mon, 3 Feb 2025 16:54:12 +0300 Subject: [PATCH] src: add nullptr handling for `NativeKeyObject` Fixes: https://github.com/nodejs/node/issues/56899 --- src/crypto/crypto_keys.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/crypto/crypto_keys.cc b/src/crypto/crypto_keys.cc index 2c55828facc35b..2ed52482062ed3 100644 --- a/src/crypto/crypto_keys.cc +++ b/src/crypto/crypto_keys.cc @@ -1063,6 +1063,7 @@ void NativeKeyObject::New(const FunctionCallbackInfo& args) { CHECK_EQ(args.Length(), 1); CHECK(args[0]->IsObject()); KeyObjectHandle* handle = Unwrap(args[0].As()); + CHECK_NOT_NULL(handle); new NativeKeyObject(env, args.This(), handle->Data()); }