bug75981.phpt 560 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Bug #75981 (stack-buffer-overflow while parsing HTTP response)
  3. --INI--
  4. allow_url_fopen=1
  5. --SKIPIF--
  6. <?php require 'server.inc'; http_server_skipif(); ?>
  7. --FILE--
  8. <?php
  9. require 'server.inc';
  10. $options = [
  11. 'http' => [
  12. 'protocol_version' => '1.1',
  13. 'header' => 'Connection: Close'
  14. ],
  15. ];
  16. $ctx = stream_context_create($options);
  17. $responses = [
  18. "data://text/plain,000000000100\xA\xA"
  19. ];
  20. ['pid' => $pid, 'uri' => $uri] = http_server($responses);
  21. echo @file_get_contents($uri, false, $ctx);
  22. http_server_kill($pid);
  23. ?>
  24. DONE
  25. --EXPECT--
  26. DONE