xref: /PHP-7.0/ext/xmlrpc/tests/bug72155.phpt (revision 1d4d8c74)
1--TEST--
2Bug #72155 (use-after-free caused by get_zval_xmlrpc_type)
3--SKIPIF--
4<?php
5if (!extension_loaded("xmlrpc")) print "skip";
6?>
7--FILE--
8<?php
9if (false !== strpos(PHP_OS, "WIN")) {
10	$fl = "c:\\windows\\explorer.exe";
11} else {
12	$fl = "/etc/passwd";
13}
14$var0 = fopen($fl,"r");
15$var1 = xmlrpc_encode($var0);
16var_dump($var1);
17?>
18--EXPECTF--
19string(109) "<?xml version="1.0" encoding="utf-8"?>
20<params>
21<param>
22 <value>
23  <int>5</int>
24 </value>
25</param>
26</params>
27"
28