mirror of
https://github.com/php/php-src.git
synced 2024-11-30 13:25:43 +08:00
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Fork test with pcre.jit=0
This commit is contained in:
commit
b50d93bc11
40
ext/fileinfo/tests/cve-2014-3538-nojit.phpt
Normal file
40
ext/fileinfo/tests/cve-2014-3538-nojit.phpt
Normal file
@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
Bug #66731: file: extensive backtraking, with pcre.jit=0
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (defined("PHP_DEBUG") && PHP_DEBUG)
|
||||
die("skip not suitable for debug build");
|
||||
if (!class_exists('finfo'))
|
||||
die('skip no fileinfo extension');
|
||||
?>
|
||||
--INI--
|
||||
pcre.jit=0
|
||||
--FILE--
|
||||
<?php
|
||||
$fd = __DIR__.'/cve-2014-3538.data';
|
||||
|
||||
file_put_contents($fd,
|
||||
'try:' .
|
||||
str_repeat("\n", 1000000));
|
||||
|
||||
$fi = finfo_open(FILEINFO_NONE);
|
||||
$t = microtime(true);
|
||||
var_dump(finfo_file($fi, $fd));
|
||||
$t = microtime(true) - $t;
|
||||
finfo_close($fi);
|
||||
if ($t < 1) {
|
||||
echo "Ok\n";
|
||||
} else {
|
||||
printf("Failed, time=%.2f\n", $t);
|
||||
}
|
||||
|
||||
?>
|
||||
Done
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__.'/cve-2014-3538.data');
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(%d) "%s"
|
||||
Ok
|
||||
Done
|
Loading…
Reference in New Issue
Block a user