[php-src] master: Merge branch 'PHP-8.6'
| From: | David Carlier | Date: | Thu, 19 Nov 2026 13:22:20 +0000 |
| Subject: | [php-src] master: Merge branch 'PHP-8.6' | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-143875@lists.php.net to get a copy of this message | ||
Author: David Carlier (devnexen)
Date: 2026-11-19T13:21:11Z
Commit: https://github.com/php/php-src/commit/0cbb910e31e70df3b00d1c235773933006cd07a8
Raw diff: https://github.com/php/php-src/commit/0cbb910e31e70df3b00d1c235773933006cd07a8.diff
Merge branch 'PHP-8.6'
* PHP-8.6:
ext/snmp: Fix the timeout argument number in snmp3_set() errors
Changed paths:
A ext/snmp/tests/snmp3_set_timeout_argument.phpt
M ext/snmp/snmp.c
Diff:
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 2f0b34416ed1..6b6c4ed1fc7e 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -1353,7 +1353,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
Z_PARAM_LONG(retries)
ZEND_PARSE_PARAMETERS_END();
- timeout_arg_num = 10;
+ timeout_arg_num = 11;
oid_arg_num = 8;
type_arg_num = 9;
value_arg_num = 10;
diff --git a/ext/snmp/tests/snmp3_set_timeout_argument.phpt
b/ext/snmp/tests/snmp3_set_timeout_argument.phpt
new file mode 100644
index 000000000000..2a3c63ed09ef
--- /dev/null
+++ b/ext/snmp/tests/snmp3_set_timeout_argument.phpt
@@ -0,0 +1,18 @@
+--TEST--
+snmp3_set() - an invalid timeout or retries cites the right argument
+--EXTENSIONS--
+snmp
+--FILE--
+<?php
+$oid = '.1.3.6.1.2.1.1.5.0';
+foreach ([[-2, 1], [100, -2]] as [$timeout, $retries]) {
+ try {
+ snmp3_set('127.0.0.1', 'user', 'noAuthNoPriv', '',
'', '', '', $oid, 's', 'x', $timeout, $retries);
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
+ }
+}
+?>
+--EXPECTF--
+ValueError: snmp3_set(): Argument #11 ($timeout) must be between -1 and %d
+ValueError: snmp3_set(): Argument #12 ($retries) must be between -1 and %d