Skip to content

Commit 2979743

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Fix GH-9589: dl() segfaults when module is already loaded Fix GH-9566: disable assembly for Fiber on FreeBSD i386.
2 parents 43f5165 + 6e0505b commit 2979743

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

ext/standard/dl.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ PHPAPI int php_load_extension(const char *filename, int type, int start_now)
205205
return FAILURE;
206206
}
207207
module_entry = get_module();
208+
if (zend_hash_str_exists(&module_registry, module_entry->name, strlen(module_entry->name))) {
209+
DL_UNLOAD(handle);
210+
zend_error(E_CORE_WARNING, "Module \"%s\" is already loaded", module_entry->name);
211+
return FAILURE;
212+
}
208213
if (module_entry->zend_api != ZEND_MODULE_API_NO) {
209214
php_error_docref(NULL, error_type,
210215
"%s: Unable to initialize module\n"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--TEST--
2+
dl() segfaults when module is already loaded
3+
--EXTENSIONS--
4+
dl_test
5+
--FILE--
6+
<?php
7+
dl("dl_test");
8+
?>
9+
--EXPECT--
10+
Warning: Module "dl_test" is already loaded in Unknown on line 0

0 commit comments

Comments
 (0)