Skip to content

Commit af17316

Browse files
Furgascmb69
authored andcommitted
Test for bug #69462
Test scenario for already fixed bug #69462 with segmentation fault when SoapVar XML node name was null.
1 parent 2ff3daf commit af17316

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

ext/soap/tests/bugs/bug69462.phpt

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
Bug #69462 __soapCall with a SoapVar that has a namespace but no name crashes
3+
--SKIPIF--
4+
<?php require_once('skipif.inc'); ?>
5+
--FILE--
6+
<?php
7+
$namespace = "http://example.com/ns";
8+
9+
$client = new SoapClient(null, [ 'exceptions' => 1, 'location' => "", 'uri' => $namespace ]);
10+
11+
$soapvar = new SoapVar(
12+
array(
13+
new SoapVar('value', XSD_STRING, null, null, null, $namespace)
14+
),
15+
SOAP_ENC_OBJECT, null, null, 'name', $namespace
16+
);
17+
18+
try {
19+
$client->__soapCall('method', array($soapvar));
20+
}
21+
catch (Exception $e) {
22+
/* ignore any errors, we're testing for segmentation fault anyway */
23+
echo "good";
24+
}
25+
--EXPECT--
26+
good

0 commit comments

Comments
 (0)