Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #35781 (stream_filter_append() causes segfault) --FILE-- <?php $filename = _..

Decoded Output download

--TEST--
Bug #35781 (stream_filter_append() causes segfault)
--FILE--
<?php

$filename = __DIR__."/bug35781.txt";

$fp = fopen($filename, "w");
stream_filter_append($fp, "string.rot13", -49);
fwrite($fp, "This is a test
");
rewind($fp);
fpassthru($fp);
fclose($fp);

var_dump(file_get_contents($filename));

@unlink($filename);

echo "Done
";
?>
--EXPECTF--
Notice: fpassthru(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
string(15) "Guvf vf n grfg
"
Done

Did this file decode correctly?

Original Code

--TEST--
Bug #35781 (stream_filter_append() causes segfault)
--FILE--
<?php

$filename = __DIR__."/bug35781.txt";

$fp = fopen($filename, "w");
stream_filter_append($fp, "string.rot13", -49);
fwrite($fp, "This is a test\n");
rewind($fp);
fpassthru($fp);
fclose($fp);

var_dump(file_get_contents($filename));

@unlink($filename);

echo "Done\n";
?>
--EXPECTF--
Notice: fpassthru(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
string(15) "Guvf vf n grfg
"
Done

Function Calls

None

Variables

None

Stats

MD5 7272320a7e0acb367a5e7f143d0611a4
Eval Count 0
Decode Time 83 ms