php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #39863
Patch bug39863.phpt revision 2010-05-12 11:23 UTC by vanderaj at owasp dot org

Patch bug39863.phpt for *General Issues Bug #39863

Patch version 2010-05-12 11:23 UTC

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

Developer: vanderaj@owasp.org

--TEST--
Test for null byte truncation in file_include on Unix platforms
--CREDITS--
Andrew van der Stock, vanderaj @ owasp.org
--SKIPIF--
<?php 
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test is for non-Windows platforms only");
?>
--FILE--
<?php
$filename = "/etc/passwd" . chr(0). ".ridiculous";

if (file_exists($filename))
{
       echo "FAIL";
}
else
{
       echo "PASS";
}
?>
--EXPECT--
string(4) "PASS"
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 06:01:29 2024 UTC