Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2020-07-12 16:49:07 +0300
committerTobias Nießen <tniessen@tnie.de>2020-07-19 13:29:53 +0300
commita6ba8deecf660e024b90123147019c2fd5728627 (patch)
treebb47173948e08c6cb7a90e82260f86540f04fc63 /src/node_crypto.cc
parent9cbfabac25e9ee4c1b792efc45195ad5dc717e22 (diff)
src: refactor CertCbDone to avoid goto statement
PR-URL: https://github.com/nodejs/node/pull/34325 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_crypto.cc')
-rw-r--r--src/node_crypto.cc7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index dfc21ae6876..60462cc114e 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -2495,10 +2495,6 @@ void SSLWrap<Base>::CertCbDone(const FunctionCallbackInfo<Value>& args) {
env->sni_context_string()).ToLocalChecked();
Local<FunctionTemplate> cons = env->secure_context_constructor_template();
- // Not an object, probably undefined or null
- if (!ctx->IsObject())
- goto fire_cb;
-
if (cons->HasInstance(ctx)) {
SecureContext* sc = Unwrap<SecureContext>(ctx.As<Object>());
CHECK_NOT_NULL(sc);
@@ -2511,14 +2507,13 @@ void SSLWrap<Base>::CertCbDone(const FunctionCallbackInfo<Value>& args) {
unsigned long err = ERR_get_error(); // NOLINT(runtime/int)
return ThrowCryptoError(env, err, "CertCbDone");
}
- } else {
+ } else if (ctx->IsObject()) {
// Failure: incorrect SNI context object
Local<Value> err = Exception::TypeError(env->sni_context_err_string());
w->MakeCallback(env->onerror_string(), 1, &err);
return;
}
- fire_cb:
CertCb cb;
void* arg;