diff --git a/NEWS b/NEWS index 1d0ed5ea88c..6164dd59a4f 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,10 @@ PHP NEWS . Fixed bug #69757 (Segmentation fault on nextRowset). (miracle at rpz dot name) +- SOAP: + . Fixed bug #70875 (Segmentation fault if wsdl has no targetNamespace + attribute). (Matteo) + - SPL: . Fixed bug #70852 Segfault getting NULL offset of an ArrayObject. (Reeze Xia) diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 355762123c7..4ba1119d35b 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -111,7 +111,7 @@ encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type) { encodePtr enc = NULL; char *nscat; - int ns_len = strlen(ns); + int ns_len = ns ? strlen(ns) : 0; int type_len = strlen(type); int len = ns_len + type_len + 1; diff --git a/ext/soap/tests/bug70875.phpt b/ext/soap/tests/bug70875.phpt new file mode 100644 index 00000000000..6f10462bfc3 --- /dev/null +++ b/ext/soap/tests/bug70875.phpt @@ -0,0 +1,50 @@ +--TEST-- +SOAP Bug #70875 - Segmentation fault if wsdl has no targetNamespace attribute +--SKIPIF-- + +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- + 1, + 'classmap' => [ + 'TestService' => 'TestService', + 'TestServiceRQ' => 'TestServiceRQ', + 'RqHeader' => 'RqHeader', + ], +]); + + +class TestService +{ + public $TestServiceRQ; +} + +class TestServiceRQ +{ + public $RqHeader; +} + +class RqHeader +{ +} + +$r = new TestService(); +$r->TestServiceRQ = new TestServiceRQ(); +$r->TestServiceRQ->RqHeader = new RqHeader(); + +$c->testService($r); + +?> +--EXPECT-- +no SIGSEGV diff --git a/ext/soap/tests/bug70875.wsdl b/ext/soap/tests/bug70875.wsdl new file mode 100644 index 00000000000..f874b9ae6cd --- /dev/null +++ b/ext/soap/tests/bug70875.wsdl @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +