-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #81490: ZipArchive::extractTo() may leak memory
We always need to free the CWD state.
- Loading branch information
1 parent
7353897
commit 80bcec9
Showing
8 changed files
with
41 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--TEST-- | ||
Bug #81490 (ZipArchive::extractTo() may leak memory) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded("zip")) die("skip zip extension not available"); | ||
?> | ||
--FILE-- | ||
<?php | ||
$zip = new ZipArchive(); | ||
$zip->open(__DIR__ . "/bug81490.zip", ZipArchive::CREATE|ZipArchive::OVERWRITE); | ||
$zip->addFromString("", "yada yada"); | ||
mkdir(__DIR__ . "/bug81490"); | ||
$zip->open(__DIR__ . "/bug81490.zip"); | ||
$zip->extractTo(__DIR__ . "/bug81490", ""); | ||
?> | ||
--EXPECT-- | ||
--CLEAN-- | ||
<?php | ||
@unlink(__DIR__ . "/bug81490.zip"); | ||
@rmdir(__DIR__ . "/bug81490"); | ||
?> |