Skip to content

Commit f5100f8

Browse files
committed
crypto: add null checks for OPENSSL_INIT_new()
Other calls in initialization code often already check for null pointers via CHECK_NOT_NULL(). Do the same here. Signed-off-by: ndossche <7771979+ndossche@users.noreply.github.com>
1 parent d955896 commit f5100f8

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/crypto/crypto_util.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ void InitCryptoOnce() {
118118
Mutex::ScopedLock fips_lock(fips_mutex);
119119
#ifndef OPENSSL_IS_BORINGSSL
120120
OPENSSL_INIT_SETTINGS* settings = OPENSSL_INIT_new();
121+
CHECK_NOT_NULL(settings);
121122

122123
#if OPENSSL_VERSION_MAJOR < 3
123124
// --openssl-config=...

src/node.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,7 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
12161216
}
12171217

12181218
OPENSSL_INIT_SETTINGS* settings = OPENSSL_INIT_new();
1219+
CHECK_NOT_NULL(settings);
12191220
OPENSSL_INIT_set_config_filename(settings, conf_file);
12201221
OPENSSL_INIT_set_config_appname(settings, conf_section_name);
12211222
OPENSSL_INIT_set_config_file_flags(settings,

0 commit comments

Comments
 (0)