Skip to content

Commit b48f6ff

Browse files
sam-githubMylesBorins
authored andcommitted
crypto: use CHECK_NE instead of ABORT or abort
Use of abort() was added in 34febfb, and changed to ABORT() in 21826ef, but conditional+ABORT() is better expressesed using a CHECK_xxx() macro. See: #9409 (comment) PR-URL: #10413 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 2f48001 commit b48f6ff

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/node_crypto.cc

+2-5
Original file line numberDiff line numberDiff line change
@@ -713,11 +713,8 @@ static X509_STORE* NewRootCertStore() {
713713
X509 *x509 = PEM_read_bio_X509(bp, nullptr, CryptoPemCallback, nullptr);
714714
BIO_free(bp);
715715

716-
if (x509 == nullptr) {
717-
// Parse errors from the built-in roots are fatal.
718-
ABORT();
719-
return nullptr;
720-
}
716+
// Parse errors from the built-in roots are fatal.
717+
CHECK_NE(x509, nullptr);
721718

722719
root_certs_vector->push_back(x509);
723720
}

0 commit comments

Comments
 (0)