summaryrefslogtreecommitdiff
path: root/ext/standard/tests/http/bug75535.phpt
blob: 236a96820c8c490cbbc5c4c13fdaecae5307bd4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--TEST--
Bug #75535: Inappropriately parsing HTTP response leads to PHP segment fault
--SKIPIF--
<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:22351'); ?>
--INI--
allow_url_fopen=1
--FILE--
<?php
require 'server.inc';

$responses = array(
    "data://text/plain,HTTP/1.0 200 Ok\r\nContent-Length\r\n",
);

$pid = http_server("tcp://127.0.0.1:22351", $responses, $output);

var_dump(file_get_contents('http://127.0.0.1:22351/'));
var_dump($http_response_header);

http_server_kill($pid);
?>
--EXPECT--
string(0) ""
array(2) {
  [0]=>
  string(15) "HTTP/1.0 200 Ok"
  [1]=>
  string(14) "Content-Length"
}