dmitry Sun Feb 25 13:24:25 2007 UTC
Modified files:
/php-src/ext/soap php_encoding.c
/php-src/ext/soap/tests/bugs bug40609.phpt bug40609.wsdl
Log:
Fixed bug #40609 (Segfaults when using more than one SoapVar in a request).
(Rob, Dmitry)
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.153&r2=1.154&diff_format=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.153
php-src/ext/soap/php_encoding.c:1.154
--- php-src/ext/soap/php_encoding.c:1.153 Sat Feb 24 16:25:55 2007
+++ php-src/ext/soap/php_encoding.c Sun Feb 25 13:24:25 2007
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_encoding.c,v 1.153 2007/02/24 16:25:55 helly Exp $ */
+/* $Id: php_encoding.c,v 1.154 2007/02/25 13:24:25 dmitry Exp $ */
#include <time.h>
@@ -2876,8 +2876,18 @@
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;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug40609.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/soap/tests/bugs/bug40609.phpt
diff -u /dev/null php-src/ext/soap/tests/bugs/bug40609.phpt:1.2
--- /dev/null Sun Feb 25 13:24:25 2007
+++ php-src/ext/soap/tests/bugs/bug40609.phpt Sun Feb 25 13:24:25 2007
@@ -0,0 +1,21 @@
+--TEST--
+Bug #40609 (Segfaults when using more than one SoapVar in a request)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+ini_set("soap.wsdl_cache_enabled", 0);
+
+$c = new SoapClient(dirname(__FILE__)."/bug40609.wsdl", array('trace' => 1,'
exceptions' => 0));
+
+$c->update(array('symbol' => new SoapVar("<symbol>MSFT</symbol>", XSD_ANYXML),
+ 'price' => new SoapVar("<price>1000</price>", XSD_ANYXML)));
+echo $c->__getLastRequest();
+echo "ok\n";
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://quickstart.samples/xsd"><SOAP-ENV:Body><ns1:update><symbol>MSFT</symbol><price>1000</price></ns1:update></SOAP-ENV:Body></SOAP-ENV:Envelope>
+ok
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug40609.wsdl?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/soap/tests/bugs/bug40609.wsdl
diff -u /dev/null php-src/ext/soap/tests/bugs/bug40609.wsdl:1.2
--- /dev/null Sun Feb 25 13:24:25 2007
+++ php-src/ext/soap/tests/bugs/bug40609.wsdl Sun Feb 25 13:24:25 2007
@@ -0,0 +1,26 @@
+<wsdl:definitions xmlns:axis2="http://quickstart.samples/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:ns="http://quickstart.samples/xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://quickstart.samples/"><wsdl:documentation>
+ Stock Quote Service
+ </wsdl:documentation><wsdl:types><xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified"
elementFormDefault="qualified" targetNamespace="http://quickstart.samples/xsd">
+<xs:element name="getPrice">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="symbol" nillable="true" type="xs:string" />
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="getPriceResponse">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="return" nillable="true" type="xs:double" />
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+<xs:element name="update">
+<xs:complexType>
+<xs:sequence>
+<xs:element name="symbol" nillable="true" type="xs:any" />
+<xs:element name="price" nillable="true" type="xs:any" />
+</xs:sequence>
+</xs:complexType>
+</xs:element>
+</xs:schema></wsdl:types><wsdl:message name="updateMessage"><wsdl:part
name="part1" element="ns:update" /></wsdl:message><wsdl:message
name="getPriceMessage"><wsdl:part name="part1" element="ns:getPrice"
/></wsdl:message><wsdl:message name="getPriceResponseMessage"><wsdl:part
name="part1" element="ns:getPriceResponse" /></wsdl:message><wsdl:portType
name="StockQuoteServicePortType"><wsdl:operation name="update"><wsdl:input
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
message="axis2:updateMessage" wsaw:Action="urn:update"
/></wsdl:operation><wsdl:operation name="getPrice"><wsdl:input
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
message="axis2:getPriceMessage" wsaw:Action="urn:getPrice" /><wsdl:output
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
message="axis2:getPriceResponseMessage"
wsaw:Action="http://quickstart.samples/StockQuoteServicePortType/getPriceResponse"
/></wsdl:operation></wsdl:portType><wsdl:binding
name="StockQuoteServiceSOAP11Bin!
ding" type="axis2:StockQuoteServicePortType"><soap:binding
transport="http://schemas.xmlsoap.org/soap/http" style="document"
/><wsdl:operation name="update"><soap:operation soapAction="urn:update"
style="document" /><wsdl:input><soap:body use="literal"
/></wsdl:input></wsdl:operation><wsdl:operation name="getPrice"><soap:operation
soapAction="urn:getPrice" style="document" /><wsdl:input><soap:body
use="literal" /></wsdl:input><wsdl:output><soap:body use="literal"
/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
name="StockQuoteServiceSOAP12Binding"
type="axis2:StockQuoteServicePortType"><soap12:binding
transport="http://schemas.xmlsoap.org/soap/http" style="document"
/><wsdl:operation name="update"><soap12:operation soapAction="urn:update"
style="document" /><wsdl:input><soap12:body use="literal"
/></wsdl:input></wsdl:operation><wsdl:operation
name="getPrice"><soap12:operation soapAction="urn:getPrice" style="document"
/><wsdl:input><soap12:body use="literal" /!
></wsdl:input><wsdl:output><soap12:body use="literal" /></wsdl:output>
</wsdl:operation></wsdl:binding><wsdl:binding
name="StockQuoteServiceHttpBinding"
type="axis2:StockQuoteServicePortType"><http:binding verb="POST"
/><wsdl:operation name="update"><http:operation location="update"
/><wsdl:input><mime:content type="text/xml"
/></wsdl:input></wsdl:operation><wsdl:operation name="getPrice"><http:operation
location="getPrice" /><wsdl:input><mime:content type="text/xml"
/></wsdl:input><wsdl:output><mime:content type="text/xml"
/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
name="StockQuoteService"><wsdl:port name="StockQuoteServiceSOAP11port_http"
binding="axis2:StockQuoteServiceSOAP11Binding"><soap:address
location="http://bluelines.org:8080/axis2/services/StockQuoteService"
/></wsdl:port><wsdl:port name="StockQuoteServiceSOAP12port_http"
binding="axis2:StockQuoteServiceSOAP12Binding"><soap12:address
location="http://bluelines.org:8080/axis2/services/StockQuoteService"
/></wsdl:port><wsdl:port name="StockQuoteServiceHttpport1" bind!
ing="axis2:StockQuoteServiceHttpBinding"><http:address location="test://"
/></wsdl:port></wsdl:service></wsdl:definitions>
\ No newline at end of file
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php