PHP  
 PHP_7_1
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

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

 

Generated at Fri, 01 Dec 2017 18:56:15 +0000 (12 days ago)

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