Skip to content

Commit 3d90a24

Browse files
committed
Fix GH-9997: OpenSSL engine clean up segfault
1 parent 3871ab2 commit 3d90a24

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ PHP NEWS
2424
. Fixed bug GH-9535 (The behavior of mb_strcut in mbstring has been changed in
2525
PHP8.1). (Nathan Freeman)
2626

27+
- OpenSSL:
28+
. Fixed bug GH-9997 (OpenSSL engine clean up segfault). (Jakub Zelenka)
29+
2730
- Pcntl:
2831
. Fixed bug GH-9298 (Signal handler called after rshutdown leads to crash).
2932
(Erki Aring)

ext/openssl/openssl.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1324,13 +1324,14 @@ PHP_MSHUTDOWN_FUNCTION(openssl)
13241324
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
13251325
EVP_cleanup();
13261326

1327+
/* prevent accessing locking callback from unloaded extension */
1328+
CRYPTO_set_locking_callback(NULL);
1329+
13271330
#ifndef OPENSSL_NO_ENGINE
13281331
/* Free engine list initialized by OPENSSL_config */
13291332
ENGINE_cleanup();
13301333
#endif
13311334

1332-
/* prevent accessing locking callback from unloaded extension */
1333-
CRYPTO_set_locking_callback(NULL);
13341335
/* free allocated error strings */
13351336
ERR_free_strings();
13361337
CONF_modules_free();

0 commit comments

Comments
 (0)