Commit 46a35fff758 for php.net
commit 46a35fff758f70201ec6739f1e188416b9c24469
Merge: 904698716e8 e1938972260
Author: Ilia Alshanetsky <ilia@ilia.ws>
Date: Fri Jul 17 15:54:01 2026 -0400
Merge branch 'PHP-8.5'
* PHP-8.5:
ext/ftp: apply the connect timeout ceiling to the remaining entry points
diff --cc ext/ftp/php_ftp.c
index 23bd69b5d63,82a45a299b3..56938459bb3
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@@ -1284,8 -1296,13 +1289,12 @@@ PHP_FUNCTION(ftp_set_option
zend_argument_value_error(3, "must be greater than 0 for the FTP_TIMEOUT_SEC option");
RETURN_THROWS();
}
+ if ((uint64_t) Z_LVAL_P(z_value) >= PHP_FTP_TIMEOUT_SEC_MAX) {
+ zend_argument_value_error(3, "must be less than " ZEND_ULONG_FMT " for the FTP_TIMEOUT_SEC option", PHP_FTP_TIMEOUT_SEC_MAX);
+ RETURN_THROWS();
+ }
ftp->timeout_sec = Z_LVAL_P(z_value);
RETURN_TRUE;
- break;
case PHP_FTP_OPT_AUTOSEEK:
if (Z_TYPE_P(z_value) != IS_TRUE && Z_TYPE_P(z_value) != IS_FALSE) {
zend_argument_type_error(3, "must be of type bool for the FTP_AUTOSEEK option, %s given", zend_zval_value_name(z_value));