Browse Source

src: clean up root_certs iteration

Drop the trailing nullptr and use ARRAY_SIZE.
archived-io.js-v0.12
Ben Noordhuis 10 years ago
parent
commit
084f3829ad
  1. 3
      src/node_crypto.cc

3
src/node_crypto.cc

@ -112,7 +112,6 @@ static uv_rwlock_t* locks;
const char* const root_certs[] = { const char* const root_certs[] = {
#include "node_root_certs.h" // NOLINT(build/include_order) #include "node_root_certs.h" // NOLINT(build/include_order)
nullptr
}; };
X509_STORE* root_cert_store; X509_STORE* root_cert_store;
@ -670,7 +669,7 @@ void SecureContext::AddRootCerts(const FunctionCallbackInfo<Value>& args) {
if (!root_cert_store) { if (!root_cert_store) {
root_cert_store = X509_STORE_new(); root_cert_store = X509_STORE_new();
for (int i = 0; root_certs[i]; i++) { for (size_t i = 0; i < ARRAY_SIZE(root_certs); i++) {
BIO* bp = NodeBIO::New(); BIO* bp = NodeBIO::New();
if (!BIO_write(bp, root_certs[i], strlen(root_certs[i]))) { if (!BIO_write(bp, root_certs[i], strlen(root_certs[i]))) {

Loading…
Cancel
Save