Skip to content

Commit 7631255

Browse files
ndosschetrivikr
authored andcommitted
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 cc57cb7 commit 7631255

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
@@ -156,6 +156,7 @@ void InitCryptoOnce() {
156156
Mutex::ScopedLock fips_lock(fips_mutex);
157157
#ifndef OPENSSL_IS_BORINGSSL
158158
OPENSSL_INIT_SETTINGS* settings = OPENSSL_INIT_new();
159+
CHECK_NOT_NULL(settings);
159160

160161
#if OPENSSL_VERSION_MAJOR < 3
161162
// --openssl-config=...

‎src/node.cc‎

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

12101210
OPENSSL_INIT_SETTINGS* settings = OPENSSL_INIT_new();
1211+
CHECK_NOT_NULL(settings);
12111212
OPENSSL_INIT_set_config_filename(settings, conf_file);
12121213
OPENSSL_INIT_set_config_appname(settings, conf_section_name);
12131214
OPENSSL_INIT_set_config_file_flags(settings,

0 commit comments

Comments
 (0)