From 1f44922e34e6e24ed4c2b959746fe994aea5bb81 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Thu, 22 Dec 2016 08:50:33 -0800 Subject: [PATCH] crypto: use CHECK_NE instead of ABORT or abort Use of abort() was added in 34febfbf4, and changed to ABORT() in 21826ef21ad, but conditional+ABORT() is better expressesed using a CHECK_xxx() macro. See: https://github.com/nodejs/node/pull/9409#discussion_r93575328 PR-URL: https://github.com/nodejs/node/pull/10413 Reviewed-By: Colin Ihrig Reviewed-By: Gibson Fahnestock Reviewed-By: Ben Noordhuis Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- src/node_crypto.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 9c0e7fff3c..3e1d043195 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -698,11 +698,8 @@ static X509_STORE* NewRootCertStore() { X509 *x509 = PEM_read_bio_X509(bp, nullptr, CryptoPemCallback, nullptr); BIO_free(bp); - if (x509 == nullptr) { - // Parse errors from the built-in roots are fatal. - ABORT(); - return nullptr; - } + // Parse errors from the built-in roots are fatal. + CHECK_NE(x509, nullptr); root_certs_vector->push_back(x509); }