php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #61807
Patch apache_request_headers.phpt revision 2012-05-05 06:20 UTC by remi@php.net
Patch apache_request_headers.patch revision 2012-05-05 06:19 UTC by remi@php.net
Patch php-apache-request-headers.patch revision 2012-04-22 01:12 UTC by nyt-php at countercultured dot net

Patch apache_request_headers.phpt for CGI/CLI related Bug #61807

Patch version 2012-05-05 06:20 UTC

Return to Bug #61807 | Download this patch
Patch Revisions:

Developer: remi@php.net

--TEST--
apache_request_headers() stack overflow.
--SKIPIF--
<?php 
include "skipif.inc"; 
?>
--FILE--
<?php
include "include.inc";

$php = get_cgi_path();
reset_env_vars();

$file = dirname(__FILE__)."/012.test.php";

file_put_contents($file, '<?php print_r(apache_request_headers()); ?>');

passthru("$php $file");

$names = array('HTTP_X_TEST', 'HTTP_X__TEST', 'HTTP_X_');
foreach ($names as $name) {
	putenv($name."=".str_repeat("A", 256));
	passthru("$php -q $file");
	putenv($name);
}
unlink($file);

echo "Done\n";
?>
--EXPECTF--	
X-Powered-By: PHP/%s
Content-type: text/html

Array
(
)
Array
(
    [X-Test] => AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
)
Array
(
    [X--Test] => AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
)
Array
(
    [X-] => AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
)
Done
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC