]> granicus.if.org Git - php/commitdiff
Test for bug #69462
authorTomasz Sawicki <falundir@gmail.com>
Thu, 25 Jun 2015 16:32:01 +0000 (18:32 +0200)
committerChristoph M. Becker <cmb@php.net>
Fri, 26 Jun 2015 21:19:29 +0000 (23:19 +0200)
Test scenario for already fixed bug #69462 with segmentation fault when
SoapVar XML node name was null.

ext/soap/tests/bugs/bug69462.phpt [new file with mode: 0644]

diff --git a/ext/soap/tests/bugs/bug69462.phpt b/ext/soap/tests/bugs/bug69462.phpt
new file mode 100644 (file)
index 0000000..011e5e2
--- /dev/null
@@ -0,0 +1,26 @@
+--TEST--
+Bug #69462 __soapCall with a SoapVar that has a namespace but no name crashes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$namespace = "http://example.com/ns";
+
+$client = new SoapClient(null, [ 'exceptions' => 1, 'location' => "", 'uri' => $namespace ]);
+
+$soapvar = new SoapVar(
+       array(
+               new SoapVar('value', XSD_STRING, null, null, null, $namespace)
+       ),
+       SOAP_ENC_OBJECT, null, null, 'name', $namespace
+);
+
+try {
+       $client->__soapCall('method', array($soapvar));
+}
+catch (Exception $e) {
+       /* ignore any errors, we're testing for segmentation fault anyway */
+       echo "good";
+}
+--EXPECT--
+good