From: Boris Lytochkin Date: Sat, 5 Feb 2011 13:22:38 +0000 (+0000) Subject: fix crash caused by incorrect offset altering X-Git-Tag: php-5.4.0alpha1~191^2~261 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c50b3d7addb1fbf8af0e0ed6b075c7c5503cd927;p=php fix crash caused by incorrect offset altering --- 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;