Skip to content

Commit

Permalink
crypto: use CHECK_NE instead of ABORT or abort
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
sam-github committed Feb 14, 2017
1 parent 129be41 commit f923028
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -713,11 +713,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);
}
Expand Down

0 comments on commit f923028

Please sign in to comment.