Skip to content

Commit

Permalink
Fix not handling fgets returning false
Browse files Browse the repository at this point in the history
  • Loading branch information
mnavarrocarter committed Dec 29, 2020
1 parent 434131d commit 919a42a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/key/SodiumKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public static function fromFile(string $filename, Random $random = null): Rotate

while (!feof($handle)) {
$line = fgets($handle);
if (!is_string($line)) {
continue;
}
$line = rtrim($line, PHP_EOL);
if ($line === '') {
continue;
Expand Down

0 comments on commit 919a42a

Please sign in to comment.