From: Dmitry Stogov Date: Sun, 25 Feb 2007 13:24:25 +0000 (+0000) Subject: Fixed bug #40609 (Segfaults when using more than one SoapVar in a request). (Rob... X-Git-Tag: RELEASE_1_0_1~160 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b0071a7e93f7df8573594c2c1e2c84eeb852408;p=php Fixed bug #40609 (Segfaults when using more than one SoapVar in a request). (Rob, Dmitry) --- diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index c062696468..f7d4084f05 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2876,8 +2876,18 @@ static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodeP ret = xmlNewTextLen(BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp)); zval_dtor(&tmp); } + ret->name = xmlStringTextNoenc; - xmlAddChild(parent, ret); + ret->parent = parent; + ret->doc = parent->doc; + ret->prev = parent->last; + ret->next = NULL; + if (parent->last) { + parent->last->next = ret; + } else { + parent->children = ret; + } + parent->last = ret; return ret; } diff --git a/ext/soap/tests/bugs/bug40609.phpt b/ext/soap/tests/bugs/bug40609.phpt new file mode 100755 index 0000000000..b6349c21f3 --- /dev/null +++ b/ext/soap/tests/bugs/bug40609.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #40609 (Segfaults when using more than one SoapVar in a request) +--SKIPIF-- + +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- + 1,' exceptions' => 0)); + +$c->update(array('symbol' => new SoapVar("MSFT", XSD_ANYXML), + 'price' => new SoapVar("1000", XSD_ANYXML))); +echo $c->__getLastRequest(); +echo "ok\n"; +?> +--EXPECT-- + +MSFT1000 +ok diff --git a/ext/soap/tests/bugs/bug40609.wsdl b/ext/soap/tests/bugs/bug40609.wsdl new file mode 100755 index 0000000000..d396d06f32 --- /dev/null +++ b/ext/soap/tests/bugs/bug40609.wsdl @@ -0,0 +1,26 @@ + + Stock Quote Service + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file