forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix phpGH-17139: Fix zip_entry_name() crash on invalid entry
Don't increment the refcount, but latter remember the ID to check afterwards whether the resource still exists. Replaces phpGH-17142.
- Loading branch information
Showing
3 changed files
with
24 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--TEST-- | ||
GH-17139 - zip_entry_name() crash | ||
--EXTENSIONS-- | ||
zip | ||
--FILE-- | ||
<?php | ||
$zip = zip_open(__DIR__."/test_procedural.zip"); | ||
if (!is_resource($zip)) die("Failure"); | ||
// no need to bother looping over, the entry name should point to a dangling address from the first iteration | ||
$zip = zip_read($zip); | ||
var_dump(zip_entry_name($zip)); | ||
?> | ||
--EXPECTF-- | ||
Deprecated: Function zip_open() is deprecated in %s on line %d | ||
|
||
Deprecated: Function zip_read() is deprecated in %s on line %d | ||
|
||
Deprecated: Function zip_entry_name() is deprecated in %s on line %d | ||
bool(false) |