--TEST-- Bug #61964 (finfo_open with directory cause invalid free) --SKIPIF-- --FILE-- Core\n> Me"); file_put_contents($dir . "/test2.txt", "a\nb\n"); @mkdir($dir . "/test-inner-folder"); finfo_open(FILEINFO_NONE, $dir); echo "DONE: testing dir with files\n"; rmdir($dir . "/test-inner-folder"); unlink($dir . "/test1.txt"); unlink($dir . "/test2.txt"); unlink($magic_file_copy); unlink($magic_file_copy2); rmdir($dir); ?> ===DONE=== --EXPECTF-- bool(false)%A resource(%d) of type (file_info) resource(%d) of type (file_info) bool(false)%A Notice: finfo_open(): Warning: offset `string' invalid in %sbug61964.php on line %d Notice: finfo_open(): Warning: offset ` Core' invalid in %sbug61964.php on line %d Notice: finfo_open(): Warning: offset ` Me' invalid in %sbug61964.php on line %d Notice: finfo_open(): Warning: offset `a' invalid in %sbug61964.php on line %d Notice: finfo_open(): Warning: offset `b' invalid in %sbug61964.php on line %d Warning: finfo_open(): Failed to load magic database at '%sbug61964'. in %sbug61964.php on line %d DONE: testing dir with files ===DONE===