Annotation of embedaddon/php/ext/fileinfo/tests/cve-2014-1943.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #66731: file: infinite recursion
3: --SKIPIF--
4: <?php
5: if (!class_exists('finfo'))
6: die('skip no fileinfo extension');
7: --FILE--
8: <?php
9: $fd = __DIR__.'/cve-2014-1943.data';
10: $fm = __DIR__.'/cve-2014-1943.magic';
11:
12: $a = "\105\122\000\000\000\000\000";
13: $b = str_repeat("\001", 250000);
14: $m = "0 byte x\n".
15: ">(1.b) indirect x\n";
16:
17: file_put_contents($fd, $a);
18: $fi = finfo_open(FILEINFO_NONE);
19: var_dump(finfo_file($fi, $fd));
20: finfo_close($fi);
21:
22: file_put_contents($fd, $b);
23: file_put_contents($fm, $m);
24: $fi = finfo_open(FILEINFO_NONE, $fm);
25: var_dump(finfo_file($fi, $fd));
26: finfo_close($fi);
27: ?>
28: Done
29: --CLEAN--
30: <?php
31: @unlink(__DIR__.'/cve-2014-1943.data');
32: @unlink(__DIR__.'/cve-2014-1943.magic');
33: ?>
34: --EXPECTF--
35: string(%d) "%s"
36:
37: Warning: finfo_file(): Failed identify data 0:(null) in %s on line %d
38: bool(false)
39: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>