Skip to content

Commit 1dc02ac

Browse files
author
Boris Lytochkin
committed
fix error reporting on OID not increasing
calling arguments markup
1 parent 1c24911 commit 1dc02ac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/snmp/snmp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,10 +837,11 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
837837
/* OID increase check */
838838
if (st & SNMP_CMD_WALK) {
839839
if (snmp_oid_compare(name, name_length, vars->name, vars->name_length) >= 0) {
840-
php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_NOT_INCREASING, "Error: OID not increasing: %s", name);
840+
snprint_objid(buf2, sizeof(buf2), vars->name, vars->name_length);
841+
php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_OID_NOT_INCREASING, "Error: OID not increasing: %s", buf2);
841842
keepwalking = 0;
842843
} else {
843-
memmove((char *)name, (char *)vars->name,vars->name_length * sizeof(oid));
844+
memmove((char *)name, (char *)vars->name, vars->name_length * sizeof(oid));
844845
name_length = vars->name_length;
845846
keepwalking = 1;
846847
}

0 commit comments

Comments
 (0)