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_012.phpt ('Bug #60159 (Router returns false, but POST is not passed to requested resource)')

Script

1: <?php
2:
include "php_cli_server.inc";
3:
php_cli_server_start('print_r($_REQUEST); $_REQUEST["foo"] = "bar"; return FALSE;');
4:
$doc_root __DIR__;
5:
file_put_contents($doc_root '/request.php''<?php print_r($_REQUEST); ?>');
6:
7: list(
$host$port) = explode(':'PHP_CLI_SERVER_ADDRESS);
8:
$port intval($port)?:80;
9:
10:
$fp fsockopen($host$port$errno$errstr0.5);
11: if (!
$fp) {
12:   die(
"connect failed");
13: }
14:
15: if(
fwrite($fp, <<<HEADER
16:
POST /request.php HTTP/1.1
17: Host: 
{$host}
18: Content-Type: application/x-www-form-urlencoded
19: Content-Length: 3
20:
21: a=b
22:
HEADER
23: )) {
24:     while (!
feof($fp)) {
25:         echo 
fgets($fp);
26:     }
27: }
28:
29:
fclose($fp);
30: @
unlink($doc_root '/request.php');
31:
32:
?>
33:

Report

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

 

Generated at Sat, 09 Sep 2017 03:10:54 +0000 (14 days ago)

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