|  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: 2020-12-11 15:57 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: lars at larsegon dot se Assigned: cmb (profile)
Status: Closed Package: PHAR related
PHP Version: 7.1.25 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: lars at larsegon dot se
New email:
PHP Version: OS:


 [2018-12-20 10:21 UTC] lars at larsegon dot se
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"));

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


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-11 15:57 UTC]
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2020-12-11 15:58 UTC]
The following pull request has been associated:

Patch Name: Fix #77322: PharData::addEmptyDir('/') Possible integer overflow
On GitHub:
 [2020-12-15 10:47 UTC]
Automatic comment on behalf of
Log: Fix #77322: PharData::addEmptyDir('/') Possible integer overflow
 [2020-12-15 10:47 UTC]
-Status: Verified +Status: Closed
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Jan 18 10:01:24 2021 UTC