Browse Source

crypto: use CHECK_NE instead of ABORT or abort

Use of abort() was added in 34febfbf4, and changed to ABORT()
in 21826ef21a, 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 <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>
v6
Sam Roberts 8 years ago
parent
commit
d9ac34cb79
  1. 5
      src/node_crypto.cc

5
src/node_crypto.cc

@ -701,11 +701,8 @@ static X509_STORE* NewRootCertStore() {
X509 *x509 = PEM_read_bio_X509(bp, nullptr, CryptoPemCallback, nullptr); X509 *x509 = PEM_read_bio_X509(bp, nullptr, CryptoPemCallback, nullptr);
BIO_free(bp); BIO_free(bp);
if (x509 == nullptr) {
// Parse errors from the built-in roots are fatal. // Parse errors from the built-in roots are fatal.
ABORT(); CHECK_NE(x509, nullptr);
return nullptr;
}
root_certs_vector->push_back(x509); root_certs_vector->push_back(x509);
} }

Loading…
Cancel
Save