Skip to content

Commit

Permalink
[BUGFIX] Avoid processing at actual end-of-file
Browse files Browse the repository at this point in the history
Fixes: #68
  • Loading branch information
ohader committed Sep 20, 2021
1 parent b7f28f4 commit 5cc2f04
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Phar/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ private function extractData(string $fileName): array

while (!feof($resource)) {
$line = fgets($resource);
// stop processing in case the system fails to read from a stream
if ($line === false) {
break;
}
// stop reading file when manifest can be extracted
if ($manifestLength !== null && $manifestContent !== null && strlen($manifestContent) >= $manifestLength) {
break;
Expand Down

0 comments on commit 5cc2f04

Please sign in to comment.