forked from php/php-src
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PHP-5.6: Fixed bug #66112 (Use after free condition in SOAP extension). (martin dot koegler at brz dot gv dot at)
- Loading branch information
Showing
3 changed files
with
180 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--TEST-- | ||
Bug #66112 (Use after free condition in SOAP extension) | ||
--SKIPIF-- | ||
<?php require_once('skipif.inc'); ?> | ||
--INI-- | ||
soap.wsdl_cache_enabled=0 | ||
--FILE-- | ||
<?php | ||
define('WSDL', dirname(__FILE__)."/bug66112.wsdl"); | ||
function Mist($p) { | ||
$client=new soapclient(WSDL, array('typemap'=>array(array("type_ns"=>"uri:mist", "type_name"=>"A")))); | ||
try{ | ||
$client->Mist(array("XX"=>"xx")); | ||
}catch(SoapFault $x){ | ||
} | ||
return array("A"=>"ABC","B"=>"sss"); | ||
} | ||
$s = new SoapServer(WSDL, array('typemap'=>array(array("type_ns"=>"uri:mist", "type_name"=>"A")))); | ||
$s->addFunction("Mist"); | ||
$_SERVER["REQUEST_METHOD"] = "POST"; | ||
$HTTP_RAW_POST_DATA=<<<EOF | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:uri="uri:mist"> | ||
<soapenv:Header/> | ||
<soapenv:Body> | ||
<uri:Request><uri:A>XXX</uri:A><uri:B>yyy</uri:B></uri:Request> | ||
</soapenv:Body> | ||
</soapenv:Envelope> | ||
EOF; | ||
echo "OK\n"; | ||
$s->handle($HTTP_RAW_POST_DATA); | ||
echo "BUG\n"; | ||
?> | ||
--EXPECT-- | ||
OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<wsdl:definitions xmlns:tns="uri:mist" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="test" targetNamespace="uri:mist"> | ||
<wsdl:types> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="uri:mist"> | ||
<xs:complexType name="T1"> | ||
<xs:sequence> | ||
<xs:element name="A" type="xsd:string"/><xs:element name="B" type="xsd:string"/> | ||
</xs:sequence> | ||
</xs:complexType> | ||
<xs:element name="Request" type="tns:T1"/><xs:element name="Response" type="tns:T1"/> | ||
</xs:schema> | ||
</wsdl:types> | ||
<wsdl:message name="Request"> | ||
<wsdl:part name="Request" element="tns:Request"/> | ||
</wsdl:message> | ||
<wsdl:message name="Response"> | ||
<wsdl:part name="Response" element="tns:Response"/> | ||
</wsdl:message> | ||
<wsdl:portType name="test"> | ||
<wsdl:operation name="Mist"> | ||
<wsdl:input message="tns:Request"/> | ||
<wsdl:output message="tns:Response"/> | ||
</wsdl:operation> | ||
</wsdl:portType> | ||
<wsdl:binding name="test" type="tns:test"> | ||
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> | ||
<wsdl:operation name="Mist"> | ||
<soap:operation soapAction="Mist"/> | ||
<wsdl:input> | ||
<soap:body use="literal"/> | ||
</wsdl:input> | ||
<wsdl:output> | ||
<soap:body use="literal"/> | ||
</wsdl:output> | ||
</wsdl:operation> | ||
</wsdl:binding> | ||
<wsdl:service name="test"> | ||
<wsdl:port name="test" binding="tns:test"> | ||
<soap:address location="http://127.0.0.1:81/mist.php"/> | ||
</wsdl:port> | ||
</wsdl:service> | ||
</wsdl:definitions> |