xref: /PHP-7.2/ext/standard/tests/http/bug75535.phpt (revision 0e097f2c)
1--TEST--
2Bug #75535: Inappropriately parsing HTTP response leads to PHP segment fault
3--SKIPIF--
4<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:22351'); ?>
5--INI--
6allow_url_fopen=1
7--FILE--
8<?php
9require 'server.inc';
10
11$responses = array(
12	"data://text/plain,HTTP/1.0 200 Ok\r\nContent-Length\r\n",
13);
14
15$pid = http_server("tcp://127.0.0.1:22351", $responses, $output);
16
17var_dump(file_get_contents('http://127.0.0.1:22351/'));
18var_dump($http_response_header);
19
20http_server_kill($pid);
21?>
22==DONE==
23--EXPECT--
24string(0) ""
25array(2) {
26  [0]=>
27  string(15) "HTTP/1.0 200 Ok"
28  [1]=>
29  string(14) "Content-Length"
30}
31==DONE==
32