From c50b3d7addb1fbf8af0e0ed6b075c7c5503cd927 Mon Sep 17 00:00:00 2001 From: Boris Lytochkin Date: Sat, 5 Feb 2011 13:22:38 +0000 Subject: [PATCH] fix crash caused by incorrect offset altering --- ext/snmp/snmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index ad38e415a7..46337ceb5d 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -843,7 +843,7 @@ retry: vars = vars->next_variable, count++); if (st & (SNMP_CMD_GET | SNMP_CMD_GETNEXT) && response->errstat == SNMP_ERR_TOOBIG && objid_set->step > 1) { /* Answer will not fit into single packet */ - objid_set->offset -= objid_set->step; + objid_set->offset = ((objid_set->offset > objid_set->step) ? (objid_set->offset - objid_set->step) : 0 ); objid_set->step /= 2; snmp_free_pdu(response); keepwalking = 1; -- 2.40.0