|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2021-06-17 09:02 UTC] arnaud dot lepeltier at cogifor dot Com
Description: ------------ When instanciating a Soap Client for a large wsdl, I encounter a segmentation fault. This has been tested on php8.0 and php 7.4. Enabling/disabling the wsdl cache has no effect. increasing the memory limit has no effect initial ticket at: https://github.com/phpro/soap-client/issues/373 Test script: --------------- <?php echo PHP_EOL, "START SCRIPT"; $url = 'https://service-test.protel.io/services/ProtelApiService.ProtelApiServiceHttpsSoap12Endpoint?wsdl'; $client = new SoapClient($url, [ 'cache_wsdl'=>WSDL_CACHE_NONE ]); echo PHP_EOL, "SOAP CLIENT CREATED"; $client->__getTypes(); echo PHP_EOL, "GET TYPES DONE"; Expected result: ---------------- START SCRIPT SOAP CLIENT CREATED GET TYPES DONE Actual result: -------------- SOAP CLIENT CREATEDErreur de segmentation (core dumped) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 16:00:01 2025 UTC |
I can reproduce the segfault, and the following patch prevents it. ext/soap/soap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 7429aebbf7..232f3bf05a 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -4827,7 +4827,9 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) /* {{{ */ } else { smart_str_appendl(buf, "UNKNOWN ", 8); } - smart_str_appends(buf, attr->name); + if (attr->name) { + smart_str_appends(buf, attr->name); + } smart_str_appendl(buf, ";\n", 2); } ZEND_HASH_FOREACH_END(); } I have no idea, though, whether that is the proper fix.