xref: /PHP-8.1/ext/zip/tests/bug81490.phpt (revision 4d442714)
1--TEST--
2Bug #81490 (ZipArchive::extractTo() may leak memory)
3--SKIPIF--
4<?php
5if (!extension_loaded("zip")) die("skip zip extension not available");
6?>
7--FILE--
8<?php
9$zip = new ZipArchive();
10$zip->open(__DIR__ . "/bug81490.zip", ZipArchive::CREATE|ZipArchive::OVERWRITE);
11$zip->addFromString("", "yada yada");
12mkdir(__DIR__ . "/bug81490");
13$zip->open(__DIR__ . "/bug81490.zip");
14$zip->extractTo(__DIR__ . "/bug81490", "");
15?>
16--EXPECT--
17--CLEAN--
18<?php
19@unlink(__DIR__ . "/bug81490.zip");
20@rmdir(__DIR__ . "/bug81490");
21?>
22