xref: /PHP-8.0/ext/soap/tests/bug70211.phpt (revision c6c9e71a)
1--TEST--
2Bug #70211 (php 7 ZEND_HASH_IF_FULL_DO_RESIZE use after free)
3--SKIPIF--
4<?php require 'skipif.inc'; ?>
5--FILE--
6<?php
7
8$addr = 0x4141414141414141;
9
10function ptr2str($ptr)
11{
12    $out = "";
13    for ($i=0; $i<8; $i++) {
14        $out .= chr($ptr & 0xff);
15        $ptr >>= 8;
16    }
17    return $out;
18}
19
20$sf = new SoapFault('1', 'string', 'detail', 'header','line', str_repeat("A",232).ptr2str($addr));
21$ob = unserialize("a:3:{i:0;".serialize($sf).'i:1;R:12;i:2;R:10;}');
22
23var_dump($ob[1]);
24?>
25--EXPECT--
26string(6) "detail"
27