bug70211.phpt 598 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Bug #70211 (php 7 ZEND_HASH_IF_FULL_DO_RESIZE use after free)
  3. --EXTENSIONS--
  4. soap
  5. --SKIPIF--
  6. <?php
  7. if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
  8. ?>
  9. --FILE--
  10. <?php
  11. $addr = 0x4141414141414141;
  12. function ptr2str($ptr)
  13. {
  14. $out = "";
  15. for ($i=0; $i<8; $i++) {
  16. $out .= chr($ptr & 0xff);
  17. $ptr >>= 8;
  18. }
  19. return $out;
  20. }
  21. $sf = new SoapFault('1', 'string', 'detail', 'header','line', str_repeat("A",232).ptr2str($addr));
  22. $ob = unserialize("a:3:{i:0;".serialize($sf).'i:1;R:13;i:2;R:11;}');
  23. var_dump($ob[1]);
  24. ?>
  25. --EXPECT--
  26. string(6) "detail"