bug_52944.phpt 624 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. Bug #52944 (segfault with zlib filter and corrupted data)
  3. --EXTENSIONS--
  4. zlib
  5. --INI--
  6. allow_url_fopen=1
  7. --FILE--
  8. <?php
  9. /* NOTE this test can fail on asm builds of zlib 1.2.5 or
  10. 1.2.7 on at least Windows and Darwin. Using unoptimized
  11. zlib build fixes the issue. */
  12. require __DIR__ . "/bug_52944_corrupted_data.inc";
  13. $fp = fopen('data://text/plain;base64,' . $data, 'r');
  14. stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
  15. var_dump(fread($fp,1));
  16. var_dump(fread($fp,1));
  17. fclose($fp);
  18. echo "Done.\n";
  19. ?>
  20. --EXPECTF--
  21. Notice: fread(): zlib: data error in %s on line %d
  22. bool(false)
  23. string(0) ""
  24. Done.