bug68996.phpt 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --TEST--
  2. Bug #68996 (Invalid free of CG(interned_empty_string))
  3. --EXTENSIONS--
  4. soap
  5. --SKIPIF--
  6. <?php
  7. if (getenv("USE_ZEND_ALLOC") !== "0")
  8. print "skip Need Zend MM disabled";
  9. ?>
  10. --FILE--
  11. <?php
  12. $s = new SoapServer(NULL, [
  13. 'uri' => 'http://foo',
  14. ]);
  15. function foo() {
  16. return new SoapFault("\xfc\x63", "some msg");
  17. }
  18. $s->addFunction("foo");
  19. // soap 1.1
  20. $HTTP_RAW_POST_DATA = <<<EOF
  21. <?xml version="1.0" encoding="UTF-8"?>
  22. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  23. <SOAP-ENV:Body>
  24. <SOAP-ENV:foo />
  25. </SOAP-ENV:Body>
  26. </SOAP-ENV:Envelope>
  27. EOF;
  28. $s->handle($HTTP_RAW_POST_DATA);
  29. // soap 1.2
  30. $HTTP_RAW_POST_DATA = <<<EOF
  31. <?xml version="1.0" encoding="UTF-8"?>
  32. <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  33. <env:Body>
  34. <env:foo />
  35. </env:Body>
  36. </env:Envelope>
  37. EOF;
  38. $s->handle($HTTP_RAW_POST_DATA);
  39. ?>
  40. --EXPECT--
  41. <?xml version="1.0" encoding="UTF-8"?>
  42. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode></faultcode><faultstring>some msg</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
  43. <?xml version="1.0" encoding="UTF-8"?>
  44. <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value></env:Value></env:Code><env:Reason><env:Text>some msg</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>