]> granicus.if.org Git - php/commitdiff
fix crash caused by incorrect offset altering
authorBoris Lytochkin <lytboris@php.net>
Sat, 5 Feb 2011 13:22:38 +0000 (13:22 +0000)
committerBoris Lytochkin <lytboris@php.net>
Sat, 5 Feb 2011 13:22:38 +0000 (13:22 +0000)
ext/snmp/snmp.c

index ad38e415a7a73915e2a5f363fc74a5c746e47d5b..46337ceb5dff3556b9f27e27eea5cfa1aac2c307 100644 (file)
@@ -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;