|  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: -
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
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

Add a Pull Request

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Sep 21 04:01:24 2020 UTC