mirror of
https://github.com/php/php-src.git
synced 2026-04-17 04:51:03 +02:00
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
22 lines
528 B
PHP
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).)*
|