1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 04:51:03 +02:00
Files
archived-php-src/ext/zip/tests/bug76524.phpt
timurib 08f08858f3 Fix bug #76524 - ZipArchive memory leak
Bugfix #76524: Free up zip internal state and adjust the tests for Windows

Bugfix #76524: Fix possible use after free for libzip 1.3.1

Bugfix #76524: Make the test independent of platform
2018-07-10 11:18:37 +02:00

22 lines
528 B
PHP

--TEST--
ZipArchive Bug #76524 (memory leak with ZipArchive::OVERWRITE flag and empty archive)
--SKIPIF--
<?php
if(!extension_loaded('zip')) die('skip');
?>
--FILE--
<?php
$filename = __DIR__ . '/nonexistent.zip';
$zip = new ZipArchive();
$zip->open($filename, ZipArchive::CREATE | ZipArchive::OVERWRITE);
echo 'ok';
/* Zip-related error messages depend on platform and libzip version,
so the regex is used to check that Zend MM does NOT show warnings
about leaks: */
?>
--EXPECTREGEX--
ok((?!memory leaks detected).)*