Skip to content

Commit 5cc2f04

Browse files
committed
[BUGFIX] Avoid processing at actual end-of-file
Fixes: #68
1 parent b7f28f4 commit 5cc2f04

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Phar/Reader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ private function extractData(string $fileName): array
101101

102102
while (!feof($resource)) {
103103
$line = fgets($resource);
104+
// stop processing in case the system fails to read from a stream
105+
if ($line === false) {
106+
break;
107+
}
104108
// stop reading file when manifest can be extracted
105109
if ($manifestLength !== null && $manifestContent !== null && strlen($manifestContent) >= $manifestLength) {
106110
break;

0 commit comments

Comments
 (0)