From 472a774405abb50f5eaf56511e84a6897f625429 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 2 Dec 2025 19:04:36 +0000 Subject: [PATCH 1/2] Fix GH-20603 issue on windows 32 bits. the timeout needed to be unsigned. --- ext/ftp/php_ftp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 0df3aa6e75524..dba5347e69603 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -158,7 +158,7 @@ PHP_FUNCTION(ftp_connect) RETURN_THROWS(); } - const zend_long timeoutmax = (zend_long)((double) PHP_TIMEOUT_ULL_MAX / 1000000.0); + const zend_ulong timeoutmax = (zend_ulong)((double) PHP_TIMEOUT_ULL_MAX / 1000000.0); if (timeout_sec <= 0) { zend_argument_value_error(3, "must be greater than 0"); @@ -166,7 +166,7 @@ PHP_FUNCTION(ftp_connect) } if (timeout_sec >= timeoutmax) { - zend_argument_value_error(3, "must be less than " ZEND_LONG_FMT, timeoutmax); + zend_argument_value_error(3, "must be less than " ZEND_ULONG_FMT, timeoutmax); RETURN_THROWS(); } From 441979632c021bab6bebdb6b71a8aec356ed0889 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 2 Dec 2025 19:20:11 +0000 Subject: [PATCH 2/2] same type as the constant then.. --- ext/ftp/php_ftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index dba5347e69603..f47fe5988176b 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -158,7 +158,7 @@ PHP_FUNCTION(ftp_connect) RETURN_THROWS(); } - const zend_ulong timeoutmax = (zend_ulong)((double) PHP_TIMEOUT_ULL_MAX / 1000000.0); + const uint64_t timeoutmax = (uint64_t)((double) PHP_TIMEOUT_ULL_MAX / 1000000.0); if (timeout_sec <= 0) { zend_argument_value_error(3, "must be greater than 0");