Skip to content

Commit 6d1fe67

Browse files
codebytereaduh95
authored andcommitted
src: -Wunreachable-code error in crypto_context.cc
PR-URL: #58901 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
1 parent 2d8e65c commit 6d1fe67

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/crypto/crypto_context.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ static const char* const root_certs[] = {
7575
#include "node_root_certs.h" // NOLINT(build/include_order)
7676
};
7777

78-
static const char system_cert_path[] = NODE_OPENSSL_SYSTEM_CERT_PATH;
79-
8078
static std::string extra_root_certs_file; // NOLINT(runtime/string)
8179

8280
static std::atomic<bool> has_cached_bundled_root_certs{false};
@@ -836,11 +834,13 @@ X509_STORE* NewRootCertStore() {
836834
X509_STORE* store = X509_STORE_new();
837835
CHECK_NOT_NULL(store);
838836

839-
if (*system_cert_path != '\0') {
837+
#ifdef NODE_OPENSSL_SYSTEM_CERT_PATH
838+
if constexpr (sizeof(NODE_OPENSSL_SYSTEM_CERT_PATH) > 1) {
840839
ERR_set_mark();
841-
X509_STORE_load_locations(store, system_cert_path, nullptr);
840+
X509_STORE_load_locations(store, NODE_OPENSSL_SYSTEM_CERT_PATH, nullptr);
842841
ERR_pop_to_mark();
843842
}
843+
#endif
844844

845845
Mutex::ScopedLock cli_lock(node::per_process::cli_options_mutex);
846846
if (per_process::cli_options->ssl_openssl_cert_store) {

0 commit comments

Comments
 (0)