bug66112.phpt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Bug #66112 (Use after free condition in SOAP extension)
  3. --EXTENSIONS--
  4. soap
  5. --INI--
  6. soap.wsdl_cache_enabled=0
  7. --FILE--
  8. <?php
  9. define('WSDL', __DIR__."/bug66112.wsdl");
  10. function Mist($p) {
  11. $client=new soapclient(WSDL, array('typemap'=>array(array("type_ns"=>"uri:mist", "type_name"=>"A"))));
  12. try{
  13. $client->Mist(array("XX"=>"xx"));
  14. }catch(SoapFault $x){
  15. }
  16. return array("A"=>"ABC","B"=>"sss");
  17. }
  18. $s = new SoapServer(WSDL, array('typemap'=>array(array("type_ns"=>"uri:mist", "type_name"=>"A"))));
  19. $s->addFunction("Mist");
  20. $_SERVER["REQUEST_METHOD"] = "POST";
  21. $HTTP_RAW_POST_DATA=<<<EOF
  22. <?xml version="1.0" encoding="UTF-8"?>
  23. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:uri="uri:mist">
  24. <soapenv:Header/>
  25. <soapenv:Body>
  26. <uri:Request><uri:A>XXX</uri:A><uri:B>yyy</uri:B></uri:Request>
  27. </soapenv:Body>
  28. </soapenv:Envelope>
  29. EOF;
  30. $s->handle($HTTP_RAW_POST_DATA);
  31. echo "OK\n";
  32. ?>
  33. --EXPECT--
  34. <?xml version="1.0" encoding="UTF-8"?>
  35. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="uri:mist"><SOAP-ENV:Body><ns1:Response><A>ABC</A><B>sss</B></ns1:Response></SOAP-ENV:Body></SOAP-ENV:Envelope>
  36. OK