xref: /PHP-8.0/ext/fileinfo/tests/bug79283.phpt (revision 7702b693)
1--TEST--
2Bug #79283 (Segfault in libmagic patch contains a buffer overflow)
3--SKIPIF--
4<?php
5if (!extension_loaded('fileinfo')) die('skip fileinfo extension not available');
6?>
7--FILE--
8<?php
9$magic_file = __DIR__ . '/bug79283.db';
10file_put_contents($magic_file, "
110	regex	\\0\\0\\0\\0	Test
12");
13
14$finfo = new finfo(FILEINFO_NONE, $magic_file);
15var_dump($finfo->buffer("buffer\n"));
16?>
17--CLEAN--
18<?php
19unlink(__DIR__ . '/bug79283.db');
20?>
21--EXPECT--
22string(10) "ASCII text"
23