From 82125936942545ed5f15767f8739db9188745dee Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 11 Oct 2025 23:59:30 +0200 Subject: [PATCH] phar: Stop early in compression test loop (#20142) --- ext/phar/phar_object.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 0ad7c5d66d7..ed4ad2516f4 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -3169,12 +3169,14 @@ static int phar_test_compression(zval *zv, void *argument) /* {{{ */ if (!PHAR_G(has_bz2)) { if (entry->flags & PHAR_ENT_COMPRESSED_BZ2) { *(int *) argument = 0; + return ZEND_HASH_APPLY_STOP; } } if (!PHAR_G(has_zlib)) { if (entry->flags & PHAR_ENT_COMPRESSED_GZ) { *(int *) argument = 0; + return ZEND_HASH_APPLY_STOP; } }