From: Ilia Alshanetsky Date: Sun, 31 May 2009 14:14:07 +0000 (+0000) Subject: MFB: Fixed bug #48359 (Script hangs on snmprealwalk if OID is not X-Git-Tag: php-5.2.10RC2~50 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=355ffae8dca1822ce431adc6a30aaf603e86ef8a;p=php MFB: Fixed bug #48359 (Script hangs on snmprealwalk if OID is not increasing) --- diff --git a/NEWS b/NEWS index e538e1cfa3..d95b02cecb 100644 --- a/NEWS +++ b/NEWS @@ -10,9 +10,12 @@ PHP NEWS arguments). (Arnaud) - Fixed bug #48378 (exif_read_data() segfaults on certain corrupted .jpeg files). (Pierre) +- Fixed bug #48359 (Script hangs on snmprealwalk if OID is not + increasing). (Ilia, simonov at gmail dot com) - Fixed bug #42143 (The constant NAN is reported as 0 on Windows) (Kanwaljeet Singla, Venkat Raman Don) + 27 May 2009, PHP 5.2.10RC1 - Updated timezone database to version 2009.8 (2009h) (Derick) diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index b3cd2771fc..0850f86cec 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -490,9 +490,14 @@ retry: if (st >= SNMP_CMD_WALK && st != SNMP_CMD_SET) { if (vars->type != SNMP_ENDOFMIBVIEW && vars->type != SNMP_NOSUCHOBJECT && vars->type != SNMP_NOSUCHINSTANCE) { - memmove((char *)name, (char *)vars->name,vars->name_length * sizeof(oid)); - name_length = vars->name_length; - keepwalking = 1; + if (snmp_oid_compare(name, name_length, vars->name, vars->name_length) >= 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error: OID not increasing: %s",name); + keepwalking = 0; + } else { + memmove((char *)name, (char *)vars->name,vars->name_length * sizeof(oid)); + name_length = vars->name_length; + keepwalking = 1; + } } } }