Skip to content

Commit 8fbbb34

Browse files
committed
crypto: check SecureContext existence
Fix: *** CID 179169: Null pointer dereferences (NULL_RETURNS) /src/node_crypto.cc: 1353 in node::crypto::SecureContext::SetClientCertEngine(const v8::FunctionCallbackInfo<v8::Value> &)() 1347 1348 // SSL_CTX_set_client_cert_engine does not itself support multiple 1349 // calls by cleaning up before overwriting the client_cert_engine 1350 // internal context variable. 1351 // Instead of trying to fix up this problem we in turn also do not 1352 // support multiple calls to SetClientCertEngine. >>> CID 179169: Null pointer dereferences (NULL_RETURNS) >>> Dereferencing a null pointer "sc". 1353 if (sc->client_cert_engine_provided_) { 1354 return env->ThrowError( 1355 "Multiple calls to SetClientCertEngine are not allowed"); 1356 } 1357 1358 const node::Utf8Value engine_id(env->isolate(), args[0]);
1 parent 2cedff9 commit 8fbbb34

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/node_crypto.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,7 @@ void SecureContext::SetClientCertEngine(
13421342
CHECK(args[0]->IsString());
13431343

13441344
SecureContext* sc = Unwrap<SecureContext>(args.This());
1345+
CHECK_NE(sc, nullptr);
13451346

13461347
MarkPopErrorOnReturn mark_pop_error_on_return;
13471348

0 commit comments

Comments
 (0)