From 0a8e474bdcb0fdcc7ffcc04b5111939bf12c19a2 Mon Sep 17 00:00:00 2001 From: Burkov Egor Date: Mon, 10 Feb 2025 18:09:22 +0300 Subject: [PATCH] src: add nullptr handling for `NativeKeyObject` Fixes: https://github.com/nodejs/node/issues/56899 PR-URL: https://github.com/nodejs/node/pull/56900 Reviewed-By: James M Snell Reviewed-By: Filip Skokan --- 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 f66c57b1079..b38a9a37773 100644 --- a/src/crypto/crypto_keys.cc +++ b/src/crypto/crypto_keys.cc @@ -1066,6 +1066,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()); }