Skip to content

Commit eb02ad0

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix GH-16237: Segmentation fault when cloning SoapServer
2 parents 2863d82 + 809a58b commit eb02ad0

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ PHP NEWS
7676
. Fixed bug #62900 (Wrong namespace on xsd import error message). (nielsdos)
7777
. Fixed bug GH-15711 (SoapClient can't convert BackedEnum to scalar value).
7878
(nielsdos)
79+
. Fixed bug GH-16237 (Segmentation fault when cloning SoapServer). (nielsdos)
7980

8081
- SPL:
8182
. Fixed bug GH-15918 (Assertion failure in ext/spl/spl_fixedarray.c).

ext/soap/soap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ PHP_MINIT_FUNCTION(soap)
412412
memcpy(&soap_server_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
413413
soap_server_object_handlers.offset = XtOffsetOf(soap_server_object, std);
414414
soap_server_object_handlers.free_obj = soap_server_object_free;
415+
soap_server_object_handlers.clone_obj = NULL;
415416

416417
/* Register SoapFault class */
417418
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)