Merge branch 'PHP-8.2' into PHP-8.3

* PHP-8.2:
  Fix GH-16237: Segmentation fault when cloning SoapServer
This commit is contained in:
Niels Dossche 2024-10-05 14:13:55 +02:00
commit eb02ad08da
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
3 changed files with 19 additions and 0 deletions

1
NEWS
View file

@ -76,6 +76,7 @@ PHP NEWS
. Fixed bug #62900 (Wrong namespace on xsd import error message). (nielsdos)
. Fixed bug GH-15711 (SoapClient can't convert BackedEnum to scalar value).
(nielsdos)
. Fixed bug GH-16237 (Segmentation fault when cloning SoapServer). (nielsdos)
- SPL:
. Fixed bug GH-15918 (Assertion failure in ext/spl/spl_fixedarray.c).

View file

@ -412,6 +412,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);

View file

@ -0,0 +1,17 @@
--TEST--
GH-16237 (Segmentation fault when cloning SoapServer)
--EXTENSIONS--
soap
--FILE--
<?php
$server = new SoapServer(null, ['uri'=>"http://testuri.org"]);
try {
clone $server;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Trying to clone an uncloneable object of class SoapServer