From 7ac760b603e6e3f97bbf7b499b788d0d917d3969 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 12 Nov 2017 15:16:36 +0100 Subject: [PATCH] src: fix SetClientCertEngine() nullptr dereference Introduced in commit 6ee985f311d ("tls: implement clientCertEngine option") which was merged November 11. PR-URL: https://github.com/nodejs/node/pull/16965 Reviewed-By: Colin Ihrig Reviewed-By: Franziska Hinkelmann Reviewed-By: James M Snell --- src/node_crypto.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index ed2782e78978a1..4d894bba6fb0b3 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -1348,7 +1348,8 @@ void SecureContext::SetClientCertEngine( CHECK_EQ(args.Length(), 1); CHECK(args[0]->IsString()); - SecureContext* sc = Unwrap(args.This()); + SecureContext* sc; + ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder()); MarkPopErrorOnReturn mark_pop_error_on_return;