From: Dmitry Stogov Date: Mon, 19 Jul 2004 13:58:10 +0000 (+0000) Subject: Fixed bugs #29109 and #29236. (WSDL cache failure) X-Git-Tag: PRE_ZEND_VM_DISPATCH_PATCH~454 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71b7a54377bf5aef68fa3fa20bb5ac15b9ebcab5;p=php Fixed bugs #29109 and #29236. (WSDL cache failure) --- diff --git a/NEWS b/NEWS index d2c6d65b6c..582c466a6c 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2004, PHP 5.1.0 +- Fixed bug #29236 (memory error when wsdl-cache is enabled). (Dmitry) +- Fixed bug #29109 (SoapFault exception: [WSDL] Out of memory). (Dmitry) - Fixed bug #29061 (soap extension segfaults). (Dmitry) - Added zlib stream filter suport. (Sara) - Changed the implementation of TRUE, FALSE, and NULL from constants to diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 9865e02cdc..d8518cb298 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -1459,14 +1459,12 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) binding->name = sdl_deserialize_string(&in); binding->location = sdl_deserialize_string(&in); WSDL_CACHE_GET_1(binding->bindingType,sdlBindingType,&in); - if (binding->bindingType == BINDING_SOAP) { - if (*in != 0) { - sdlSoapBindingPtr soap_binding = binding->bindingAttributes = emalloc(sizeof(sdlSoapBinding)); - WSDL_CACHE_GET_1(soap_binding->style,sdlEncodingStyle,&in); - WSDL_CACHE_GET_1(soap_binding->transport,sdlTransport,&in); - } else { - WSDL_CACHE_SKIP(1,&in); - } + if (binding->bindingType == BINDING_SOAP && *in != 0) { + sdlSoapBindingPtr soap_binding = binding->bindingAttributes = emalloc(sizeof(sdlSoapBinding)); + WSDL_CACHE_GET_1(soap_binding->style,sdlEncodingStyle,&in); + WSDL_CACHE_GET_1(soap_binding->transport,sdlTransport,&in); + } else { + WSDL_CACHE_SKIP(1,&in); } bindings[i] = binding; } @@ -1490,18 +1488,16 @@ static sdlPtr get_sdl_from_cache(const char *fn, const char *uri, time_t t) } else { func->binding = bindings[binding_num-1]; } - if (func->binding && func->binding->bindingType == BINDING_SOAP) { - if (*in != 0) { - sdlSoapBindingFunctionPtr binding = func->bindingAttributes = emalloc(sizeof(sdlSoapBindingFunction)); - memset(binding, 0, sizeof(sdlSoapBindingFunction)); - WSDL_CACHE_GET_1(binding->style,sdlEncodingStyle,&in); - binding->soapAction = sdl_deserialize_string(&in); - sdl_deserialize_soap_body(&binding->input, encoders, types, &in); - sdl_deserialize_soap_body(&binding->output, encoders, types, &in); - } else { - WSDL_CACHE_SKIP(1, &in); - func->bindingAttributes = NULL; - } + if (func->binding && func->binding->bindingType == BINDING_SOAP && *in != 0) { + sdlSoapBindingFunctionPtr binding = func->bindingAttributes = emalloc(sizeof(sdlSoapBindingFunction)); + memset(binding, 0, sizeof(sdlSoapBindingFunction)); + WSDL_CACHE_GET_1(binding->style,sdlEncodingStyle,&in); + binding->soapAction = sdl_deserialize_string(&in); + sdl_deserialize_soap_body(&binding->input, encoders, types, &in); + sdl_deserialize_soap_body(&binding->output, encoders, types, &in); + } else { + WSDL_CACHE_SKIP(1, &in); + func->bindingAttributes = NULL; } func->requestParameters = sdl_deserialize_parameters(encoders, types, &in); diff --git a/ext/soap/tests/bugs/bug29109.phpt b/ext/soap/tests/bugs/bug29109.phpt new file mode 100644 index 0000000000..91d3ea265f --- /dev/null +++ b/ext/soap/tests/bugs/bug29109.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #29109 (Uncaught SoapFault exception: [WSDL] Out of memory) +--SKIPIF-- + +--FILE-- +__getFunctions()); +?> +--EXPECT-- +array(3) { + [0]=> + string(53) "HelloWorldResponse HelloWorld(HelloWorld $parameters)" + [1]=> + string(19) "string HelloWorld()" + [2]=> + string(19) "string HelloWorld()" +} \ No newline at end of file diff --git a/ext/soap/tests/bugs/bug29109.wsdl b/ext/soap/tests/bugs/bug29109.wsdl new file mode 100644 index 0000000000..800cd2357d --- /dev/null +++ b/ext/soap/tests/bugs/bug29109.wsdl @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ext/soap/tests/bugs/bug29236.phpt b/ext/soap/tests/bugs/bug29236.phpt new file mode 100644 index 0000000000..372449fbb2 --- /dev/null +++ b/ext/soap/tests/bugs/bug29236.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #29236 (memory error when wsdl-cache is enabled) +--SKIPIF-- + +--FILE-- +__getFunctions()); +?> +--EXPECT-- +array(4) { + [0]=> + string(59) "StartSessionResponse StartSession(StartSession $parameters)" + [1]=> + string(62) "VerifySessionResponse VerifySession(VerifySession $parameters)" + [2]=> + string(41) "LogoutResponse Logout(Logout $parameters)" + [3]=> + string(62) "GetSystemInfoResponse GetSystemInfo(GetSystemInfo $parameters)" +} \ No newline at end of file diff --git a/ext/soap/tests/bugs/bug29236.wsdl b/ext/soap/tests/bugs/bug29236.wsdl new file mode 100644 index 0000000000..d60a4871d4 --- /dev/null +++ b/ext/soap/tests/bugs/bug29236.wsdl @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file