Skip to content

Commit 6fa3c73

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 <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent a118bb8 commit 6fa3c73

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/node_crypto.cc

Lines changed: 2 additions & 5 deletions
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)