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 25e563f commit cf77281
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 @@ -100,6 +100,10 @@ private function extractData($fileName)

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 cf77281

Please sign in to comment.