php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77322 PharData::addEmptyDir('/') Possible integer overflow
Submitted: 2018-12-20 10:21 UTC Modified: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: lars at larsegon dot se Assigned:
Status: Open Package: PHAR related
PHP Version: 7.1.25 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-12-20 10:21 UTC] lars at larsegon dot se
Description:
------------
When trying to add the empty directory '/' to a phar archive PHP throws a fatal error:
PHP Fatal error:  Possible integer overflow in memory allocation (1 * 18446744073709551615 + 1) in /path/to/my/script.php on line 91

The same action works in ZipArchive, i.e. this works:
$zip = new \ZipArchive;
$zip->open(tempnam(sys_get_temp_dir(), "phptest"));
$zip->addEmptyDir("/");

Test script:
---------------
$tar = new \PharData("/tmp/phptempfile");
$tar->addEmptyDir("/");
// Fatal error Possible Integer overflow


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 00:01:25 2019 UTC