diff --git a/NEWS b/NEWS index 85f4638ba7d..3a276b116fd 100644 --- a/NEWS +++ b/NEWS @@ -90,6 +90,9 @@ PHP NEWS . Fixed bug GHSA-9pqp-7h25-4f32 (Erroneous parsing of multipart form data). (CVE-2024-8925) (Arnaud) +- SOAP: + . Fixed bug GH-16237 (Segmentation fault when cloning SoapServer). (nielsdos) + - Standard: . Fixed bug GH-16053 (Assertion failure in Zend/zend_hash.c). (Arnaud) . Fixed bug GH-15169 (stack overflow when var serialization in diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 02ff10ae4d9..5e667ef14c6 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -508,6 +508,7 @@ PHP_MINIT_FUNCTION(soap) memcpy(&soap_server_object_handlers, &std_object_handlers, sizeof(zend_object_handlers)); soap_server_object_handlers.offset = XtOffsetOf(soap_server_object, std); soap_server_object_handlers.free_obj = soap_server_object_free; + soap_server_object_handlers.clone_obj = NULL; /* Register SoapFault class */ soap_fault_class_entry = register_class_SoapFault(zend_ce_exception); diff --git a/ext/soap/tests/bugs/gh16237.phpt b/ext/soap/tests/bugs/gh16237.phpt new file mode 100644 index 00000000000..468f2794399 --- /dev/null +++ b/ext/soap/tests/bugs/gh16237.phpt @@ -0,0 +1,17 @@ +--TEST-- +GH-16237 (Segmentation fault when cloning SoapServer) +--EXTENSIONS-- +soap +--FILE-- +"http://testuri.org"]); +try { + clone $server; +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + +?> +--EXPECT-- +Trying to clone an uncloneable object of class SoapServer