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 <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>
  • Loading branch information
sam-github committed Dec 29, 2016
1 parent 3d290d2 commit d9ac34c
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 @@ -701,11 +701,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 d9ac34c

Please sign in to comment.