PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Valgrind Report for sapi/cli/tests/bug70470.phpt ('Bug #70470 (Built-in server truncates headers spanning over TCP packets)')

Script

1: <?php
2:
include "php_cli_server.inc";
3:
php_cli_server_start("var_dump(getAllheaders());");
4:
5:
$fp fsockopen(PHP_CLI_SERVER_HOSTNAMEPHP_CLI_SERVER_PORT$errno$errmsg0.5);
6:
7: if (!
$fp) {
8:     die(
"connect failed: " $errmsg);
9: }
10:
11:
fwrite($fp"GET / HTTP/1.1\r\n");
12:
fwrite($fp"Host: " PHP_CLI_SERVER_HOSTNAME "\r\n");
13:
fwrite($fp"Content");
14:
fflush($fp);
15:
usleep(200000);
16:
fwrite($fp"-Type: text/html; charset=UTF-8\r\n");
17:
fwrite($fp"Connection: clo");
18:
fflush($fp);
19:
usleep(200000);
20:
fwrite($fp"se\r\n\r\n");
21: while (!
feof($fp)) {
22:     echo 
fgets($fp);
23: }
24:
fclose($fp);
25:
?>
26:

Report

==17838== Jump to the invalid address stated on the next line
==17838==    at 0x4FE: ???
==17838==  Address 0x4fe is not stack'd, malloc'd or (recently) free'd
==17838== 
==17838== 
==17838== Process terminating with default action of signal 11 (SIGSEGV)
==17838==  Bad permissions for mapped region at address 0x4FE
==17838==    at 0x4FE: ???

 

Generated at Sun, 12 Nov 2017 21:17:35 +0000 (10 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.