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/php_cli_server_017.phpt ('Implement Req #60850 (Built in web server does not set $_SERVER['SCRIPT_FILENAME'] when using router)')

Script

1: <?php
2:
include "php_cli_server.inc";
3:
php_cli_server_start(<<<'PHP'
4:
var_dump($_SERVER['SCRIPT_FILENAME']);
5:
PHP
6: );
7:
8: list(
$host$port) = explode(':'PHP_CLI_SERVER_ADDRESS);
9:
$port intval($port)?:80;
10:
11:
$fp fsockopen($host$port$errno$errstr0.5);
12: if (!
$fp) {
13:   die(
"connect failed");
14: }
15:
16: if(
fwrite($fp, <<<HEADER
17:
POST / HTTP/1.1
18: Host: 
{$host}
19:
20:
21:
HEADER
22: )) {
23:     while (!
feof($fp)) {
24:         echo 
fgets($fp);
25:     }
26: }
27:
28:
fclose($fp);
29:
?>
30:

Report

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

 

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

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