xref: /PHP-7.4/ext/phar/tests/bug77322.phpt (revision a53d67ce)
1--TEST--
2Bug #77322 (PharData::addEmptyDir('/') Possible integer overflow)
3--SKIPIF--
4<?php
5if (!extension_loaded('phar')) die('skip phar extension not available');
6?>
7--FILE--
8<?php
9$zip = new PharData(__DIR__ . '/bug77322.zip');
10$zip->addEmptyDir('/');
11var_dump($zip->count());
12
13$tar = new PharData(__DIR__ . '/bug77322.tar');
14$tar->addEmptyDir('/');
15var_dump($tar->count());
16?>
17--EXPECT--
18int(1)
19int(1)
20--CLEAN--
21<?php
22unlink(__DIR__ . '/bug77322.zip');
23unlink(__DIR__ . '/bug77322.tar');
24?>
25