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

Valgrind Report for tests/basic/bug67198.phpt ('php://input is empty when enable_post_data_reading=Off')

Script

1: <?php
2:
require __DIR__."/../../sapi/cli/tests/php_cli_server.inc";
3:
4:
$code =
5: <<<'FL'
6:
 if(!ini_get('enable_post_data_reading')){
7:   if($_SERVER['REQUEST_METHOD']=='POST'){
8:    exit(file_get_contents('php://input'));
9:   }
10:  }else{
11:   exit('Please SET php.ini: enable_post_data_reading = Off');
12:  }
13:
FL;
14:
15:
$postdata "PASS";
16:
17:
$opts = array('http' =>
18:     array(
19:         
'method'  => 'POST',
20:         
'header'  => 'Content-type: application/x-www-form-urlencoded',
21:         
'content' => $postdata
22:     
)
23: );
24:
25:
$context  stream_context_create($opts);
26:
27:
php_cli_server_start("exit(file_get_contents('php://input'));"false"-d enable_post_data_reading=Off");
28:
29:
var_dump(file_get_contents("http://" PHP_CLI_SERVER_ADDRESSfalse$context));
30:
var_dump(file_get_contents("http://" PHP_CLI_SERVER_ADDRESSfalse$context));
31:

Report

==2883== Jump to the invalid address stated on the next line
==2883==    at 0x4FE: ???
==2883==    by 0xD8FCF8F: ??? (in /lib64/libkrb5.so.3.3)
==2883==    by 0x400F2DB: _dl_name_match_p (in /lib64/ld-2.12.so)
==2883==    by 0x4009C04: do_lookup_x (in /lib64/ld-2.12.so)
==2883==    by 0x400A269: _dl_lookup_symbol_x (in /lib64/ld-2.12.so)
==2883==    by 0x400BAB3: _dl_relocate_object (in /lib64/ld-2.12.so)
==2883==    by 0x4003A08: dl_main (in /lib64/ld-2.12.so)
==2883==    by 0x401640D: _dl_sysdep_start (in /lib64/ld-2.12.so)
==2883==    by 0x40014D3: _dl_start (in /lib64/ld-2.12.so)
==2883==    by 0x4000B37: ??? (in /lib64/ld-2.12.so)
==2883==    by 0x7: ???
==2883==    by 0x1FFF00075E: ???
==2883==  Address 0x4fe is not stack'd, malloc'd or (recently) free'd
==2883== 
==2883== 
==2883== Process terminating with default action of signal 11 (SIGSEGV)
==2883==  Bad permissions for mapped region at address 0x4FE
==2883==    at 0x4FE: ???
==2883==    by 0xD8FCF8F: ??? (in /lib64/libkrb5.so.3.3)
==2883==    by 0x400F2DB: _dl_name_match_p (in /lib64/ld-2.12.so)
==2883==    by 0x4009C04: do_lookup_x (in /lib64/ld-2.12.so)
==2883==    by 0x400A269: _dl_lookup_symbol_x (in /lib64/ld-2.12.so)
==2883==    by 0x400BAB3: _dl_relocate_object (in /lib64/ld-2.12.so)
==2883==    by 0x4003A08: dl_main (in /lib64/ld-2.12.so)
==2883==    by 0x401640D: _dl_sysdep_start (in /lib64/ld-2.12.so)
==2883==    by 0x40014D3: _dl_start (in /lib64/ld-2.12.so)
==2883==    by 0x4000B37: ??? (in /lib64/ld-2.12.so)
==2883==    by 0x7: ???
==2883==    by 0x1FFF00075E: ???

 

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

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