Skip to content

Commit

Permalink
RemoteFilesystem: fix result length check (#10656)
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubinix committed Mar 26, 2022
1 parent f459b9b commit 37627f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Composer/Util/RemoteFilesystem.php
Expand Up @@ -526,7 +526,7 @@ protected function getRemoteContents(string $originUrl, string $fileUrl, $contex
} catch (\Throwable $e) {
}

if ($maxFileSize !== null && Platform::strlen($result) >= $maxFileSize) {
if ($result !== false && $maxFileSize !== null && Platform::strlen($result) >= $maxFileSize) {
throw new MaxFileSizeExceededException('Maximum allowed download size reached. Downloaded ' . Platform::strlen($result) . ' of allowed ' . $maxFileSize . ' bytes');
}

Expand Down

0 comments on commit 37627f1

Please sign in to comment.