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

==28323== Jump to the invalid address stated on the next line
==28323==    at 0x4FE: ???
==28323==    by 0x40056AF: open_verify (in /lib64/ld-2.12.so)
==28323==    by 0x4005D5A: open_path (in /lib64/ld-2.12.so)
==28323==    by 0x4008973: _dl_map_object (in /lib64/ld-2.12.so)
==28323==    by 0x400C701: openaux (in /lib64/ld-2.12.so)
==28323==    by 0x400E5E8: _dl_catch_error (in /lib64/ld-2.12.so)
==28323==    by 0x400CDE4: _dl_map_object_deps (in /lib64/ld-2.12.so)
==28323==    by 0x40034C7: dl_main (in /lib64/ld-2.12.so)
==28323==    by 0x401640D: _dl_sysdep_start (in /lib64/ld-2.12.so)
==28323==    by 0x40014D3: _dl_start (in /lib64/ld-2.12.so)
==28323==    by 0x4000B37: ??? (in /lib64/ld-2.12.so)
==28323==    by 0x7: ???
==28323==  Address 0x4fe is not stack'd, malloc'd or (recently) free'd
==28323== 
==28323== 
==28323== Process terminating with default action of signal 11 (SIGSEGV)
==28323==  Bad permissions for mapped region at address 0x4FE
==28323==    at 0x4FE: ???
==28323==    by 0x40056AF: open_verify (in /lib64/ld-2.12.so)
==28323==    by 0x4005D5A: open_path (in /lib64/ld-2.12.so)
==28323==    by 0x4008973: _dl_map_object (in /lib64/ld-2.12.so)
==28323==    by 0x400C701: openaux (in /lib64/ld-2.12.so)
==28323==    by 0x400E5E8: _dl_catch_error (in /lib64/ld-2.12.so)
==28323==    by 0x400CDE4: _dl_map_object_deps (in /lib64/ld-2.12.so)
==28323==    by 0x40034C7: dl_main (in /lib64/ld-2.12.so)
==28323==    by 0x401640D: _dl_sysdep_start (in /lib64/ld-2.12.so)
==28323==    by 0x40014D3: _dl_start (in /lib64/ld-2.12.so)
==28323==    by 0x4000B37: ??? (in /lib64/ld-2.12.so)
==28323==    by 0x7: ???

 

Generated at Sat, 01 Dec 2018 10:41:11 +0000 (9 days ago)

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