summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Lytochkin <lytboris@php.net>2011-02-05 13:22:38 +0000
committerBoris Lytochkin <lytboris@php.net>2011-02-05 13:22:38 +0000
commitc50b3d7addb1fbf8af0e0ed6b075c7c5503cd927 (patch)
treea510c3d8c260c17db6c4e2ecf9553c2f5573f26e
parentf69e1100ce78fbabe3803d8d873abf90b50afde7 (diff)
downloadphp-git-c50b3d7addb1fbf8af0e0ed6b075c7c5503cd927.tar.gz
fix crash caused by incorrect offset altering
-rw-r--r--ext/snmp/snmp.c2
1 files changed, 1 insertions, 1 deletions
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;