Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ext/soap/soap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
17 changes: 17 additions & 0 deletions ext/soap/tests/bugs/gh16237.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--TEST--
GH-16237 (Segmentation fault when cloning SoapServer)
--EXTENSIONS--
soap
--FILE--
<?php

$server = new SoapServer(null, ['uri'=>"http://testuri.org"]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we need to connect to a server, the test should be marked as offline test. Otherwise, me may use an .invalid domain here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't connect to a server.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I suggest to use an invalid domain per RFC 6761, sec. 6.4.

try {
clone $server;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}

?>
--EXPECT--
Trying to clone an uncloneable object of class SoapServer
Loading