Skip to content

Commit 3d3c192

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Fix phpGH-16237: Segmentation fault when cloning SoapServer
2 parents 671200a + 70203c7 commit 3d3c192

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

ext/soap/soap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ PHP_MINIT_FUNCTION(soap)
508508
memcpy(&soap_server_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
509509
soap_server_object_handlers.offset = XtOffsetOf(soap_server_object, std);
510510
soap_server_object_handlers.free_obj = soap_server_object_free;
511+
soap_server_object_handlers.clone_obj = NULL;
511512

512513
/* Register SoapFault class */
513514
soap_fault_class_entry = register_class_SoapFault(zend_ce_exception);

ext/soap/tests/bugs/gh16237.phpt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
GH-16237 (Segmentation fault when cloning SoapServer)
3+
--EXTENSIONS--
4+
soap
5+
--FILE--
6+
<?php
7+
8+
$server = new SoapServer(null, ['uri'=>"http://testuri.org"]);
9+
try {
10+
clone $server;
11+
} catch (Error $e) {
12+
echo $e->getMessage(), "\n";
13+
}
14+
15+
?>
16+
--EXPECT--
17+
Trying to clone an uncloneable object of class SoapServer

0 commit comments

Comments
 (0)