]> granicus.if.org Git - php/commitdiff
MFB: Fixed bug #48359 (Script hangs on snmprealwalk if OID is not
authorIlia Alshanetsky <iliaa@php.net>
Sun, 31 May 2009 14:14:07 +0000 (14:14 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 31 May 2009 14:14:07 +0000 (14:14 +0000)
increasing)

NEWS
ext/snmp/snmp.c

diff --git a/NEWS b/NEWS
index e538e1cfa3ff9e8c6a0c5cc669a29c5f66768db9..d95b02cecbd196d87460bb0218434114c5eadfd3 100644 (file)
--- 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)
 
index b3cd2771fc1355673fff35b6eb8a636810fd2c22..0850f86ceca43c013b590be01761c1030f15c90d 100644 (file)
@@ -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;
+                                                       }
                                                }
                                        }
                                }