Commit ff51ac161d6 for php.net
commit ff51ac161d6ccf088f5d434f914619506b8ab2b6
Author: David Carlier <devnexen@gmail.com>
Date: Tue Dec 2 19:04:36 2025 +0000
Fix GH-20603 issue on windows 32 bits.
the timeout needed to be unsigned.
close GH-20634
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index 0df3aa6e755..f47fe598817 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 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");
@@ -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();
}