xref: /PHP-7.4/ext/standard/tests/http/bug75981.phpt (revision 523f230c)
1--TEST--
2Bug #75981 (stack-buffer-overflow while parsing HTTP response)
3--INI--
4allow_url_fopen=1
5--SKIPIF--
6<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?>
7--FILE--
8<?php
9require 'server.inc';
10
11$options = [
12  'http' => [
13    'protocol_version' => '1.1',
14    'header' => 'Connection: Close'
15  ],
16];
17
18$ctx = stream_context_create($options);
19
20$responses = [
21	"data://text/plain,000000000100\xA\xA"
22];
23$pid = http_server('tcp://127.0.0.1:12342', $responses);
24
25echo @file_get_contents('http://127.0.0.1:12342/', false, $ctx);
26
27http_server_kill($pid);
28
29?>
30DONE
31--EXPECT--
32DONE
33