From: Dmitry Stogov Date: Thu, 26 Aug 2004 15:23:57 +0000 (+0000) Subject: Fixed bug #29795 (SegFault with Soap and Amazon's Web Services) X-Git-Tag: php-5.0.2RC1~87 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb19590b7ead60ab8534b391be26c2615e6cfc4c;p=php Fixed bug #29795 (SegFault with Soap and Amazon's Web Services) Fixed bug #27994 (segfault with Soapserver when WSDL-Cache is enabled) --- diff --git a/NEWS b/NEWS index 2fe020f7d0..769388bfbb 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ PHP NEWS - Fixed bug #29821 (Fixed possible crashes in convert_uudecode() on invalid data). (Ilia) - Fixed bug #29808 (array_count_values() breaks with numeric strings). (Ilia) +- Fixed bug #29795 (SegFault with Soap and Amazon's Web Services). (Dmitry) - Fixed bug #29737 (ip2long should return -1 if IP is 255.255.255.255 and FALSE on error). (Tony) - Fixed bug #29711 (Changed ext/xml to default to UTF-8 output). (Rob) @@ -25,6 +26,8 @@ PHP NEWS (Christian, Rob) - Fixed bug #29656 (segfault on result and statement properties). (Georg) - Fixed bug #29447 (Reflection API issues). (Marcus) +- Fixed bug #27994 (segfault with Soapserver when WSDL-Cache is enabled). + (Dmitry) - Fixed bug #27791 (Apache 2.0 SAPI build against Apache 2 HEAD). (Joe Orton, Derick) - Fixed bug #26737 (private/protected properties not serialized when user diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 08e80c223f..05e2d5143c 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2437,6 +2437,9 @@ zval *sdl_guess_convert_zval(encodeTypePtr enc, xmlNodePtr data) sdlTypePtr type; type = enc->sdl_type; + if (type == NULL) { + return guess_zval_convert(enc, data); + } /*FIXME: restriction support if (type && type->restrictions && data && data->children && data->children->content) { @@ -2500,6 +2503,13 @@ xmlNodePtr sdl_guess_convert_xml(encodeTypePtr enc, zval *data, int style, xmlNo type = enc->sdl_type; + if (type == NULL) { + ret = guess_xml_convert(enc, data, style, parent); + if (style == SOAP_ENCODED) { + set_ns_and_type(ret, enc); + } + return ret; + } /*FIXME: restriction support if (type) { if (type->restrictions && Z_TYPE_P(data) == IS_STRING) { diff --git a/ext/soap/tests/bugs/bug29795.phpt b/ext/soap/tests/bugs/bug29795.phpt new file mode 100644 index 0000000000..f32d16a996 --- /dev/null +++ b/ext/soap/tests/bugs/bug29795.phpt @@ -0,0 +1,32 @@ +--TEST-- +Bug #29795 (SegFault with Soap and Amazon's Web Services) +--SKIPIF-- + +--FILE-- +SoapClient($wsdl, $options); + } + + function __doRequest($request, $location, $action, $version) { + return <<3995USD +EOF; + } + +} + +$client = new LocalSoapClient(dirname(__FILE__)."/bug29795.wsdl",array("trace"=>1)); +$ar=$client->GetPrice(); +echo "o"; +$client = new LocalSoapClient(dirname(__FILE__)."/bug29795.wsdl",array("trace"=>1)); +$ar=$client->GetPrice(); +echo "k\n"; +?> +--EXPECT-- +ok diff --git a/ext/soap/tests/bugs/bug29795.wsdl b/ext/soap/tests/bugs/bug29795.wsdl new file mode 100644 index 0000000000..5a4499da0d --- /dev/null +++ b/ext/soap/tests/bugs/bug29795.wsdl @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +