From 37627f10d0500a11aa94f3981b85c4cd6fdefbd5 Mon Sep 17 00:00:00 2001 From: Stephan Date: Sat, 26 Mar 2022 13:42:57 +0000 Subject: [PATCH] RemoteFilesystem: fix result length check (#10656) --- src/Composer/Util/RemoteFilesystem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index a22998e55..f7daa283d 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -526,7 +526,7 @@ class RemoteFilesystem } 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'); }