xref: /PHP-8.3/ext/fileinfo/tests/bug79283.phpt (revision bd9f4fa6)
1--TEST--
2Bug #79283 (Segfault in libmagic patch contains a buffer overflow)
3--EXTENSIONS--
4fileinfo
5--FILE--
6<?php
7$magic_file = __DIR__ . '/bug79283.db';
8file_put_contents($magic_file, "
90	regex	\\0\\0\\0\\0	Test
10");
11
12$finfo = new finfo(FILEINFO_NONE, $magic_file);
13var_dump($finfo->buffer("buffer\n"));
14?>
15--CLEAN--
16<?php
17unlink(__DIR__ . '/bug79283.db');
18?>
19--EXPECT--
20string(10) "ASCII text"
21