Skip to content

Commit 4abc6ea

Browse files
danbevOlivier Martin
authored andcommitted
src: make root_cert_vector function scoped
root_cert_vector currently has file scope and external linkage, but is only used in the NewRootCertsStore function. If this is not required to be externally linked perhaps it can be changed to be static and function scoped instead. PR-URL: nodejs#12788 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
1 parent 01dd9e4 commit 4abc6ea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/node_crypto.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ const char* const root_certs[] = {
152152
std::string extra_root_certs_file; // NOLINT(runtime/string)
153153

154154
X509_STORE* root_cert_store;
155-
std::vector<X509*> root_certs_vector;
156155

157156
// Just to generate static methods
158157
template class SSLWrap<TLSWrap>;
@@ -724,6 +723,7 @@ static int X509_up_ref(X509* cert) {
724723

725724

726725
static X509_STORE* NewRootCertStore() {
726+
static std::vector<X509*> root_certs_vector;
727727
if (root_certs_vector.empty()) {
728728
for (size_t i = 0; i < arraysize(root_certs); i++) {
729729
BIO* bp = NodeBIO::NewFixed(root_certs[i], strlen(root_certs[i]));

0 commit comments

Comments
 (0)