From dcaaa1bc7b539916c87d29e0406fe79ba5fa355f Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 16 Apr 2025 13:12:50 +0200 Subject: [PATCH] Tweak error message to include the package name, refs #12369 --- src/Composer/Downloader/ZipDownloader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Downloader/ZipDownloader.php b/src/Composer/Downloader/ZipDownloader.php index 54d23a5c6..4f6a7c452 100644 --- a/src/Composer/Downloader/ZipDownloader.php +++ b/src/Composer/Downloader/ZipDownloader.php @@ -229,11 +229,11 @@ class ZipDownloader extends ArchiveDownloader } $totalSize += $stat['size']; if ($stat['size'] > $stat['comp_size'] * 200) { - throw new \RuntimeException('Invalid zip file with compression ratio >99% (possible zip bomb)'); + throw new \RuntimeException('Invalid zip file for "'.$package->getName().'" with compression ratio >99% (possible zip bomb)'); } } if ($archiveSize !== false && $totalSize > $archiveSize * 100 && $totalSize > 50*1024*1024) { - throw new \RuntimeException('Invalid zip file with compression ratio >99% (possible zip bomb)'); + throw new \RuntimeException('Invalid zip file for "'.$package->getName().'" with compression ratio >99% (possible zip bomb)'); } }