components/net-snmp/patches/050.19616465.patch
author Jiri Sasek <Jiri.Sasek@Oracle.COM>
Wed, 04 May 2016 14:21:51 -0700
changeset 5920 1e847165fde2
parent 2095 36b59963fa00
permissions -rw-r--r--
23210161 gamin fails to build on userland nightly (99)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2095
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     1
http://sourceforge.net/p/net-snmp/code/ci/4c5633f1603e4bd03ed05c37d782ec8911759c47/
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     2
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     3
diff --git a/agent/mibgroup/agent/extend.c b/agent/mibgroup/agent/extend.c
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     4
index 00d270a..cd0b2d6 100644
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     5
--- a/agent/mibgroup/agent/extend.c
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     6
+++ b/agent/mibgroup/agent/extend.c
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     7
@@ -1132,7 +1132,7 @@ _extend_find_entry( netsnmp_request_info       *request,
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     8
              * ...and check the line requested is valid
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
     9
              */
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    10
             line_idx = *table_info->indexes->next_variable->val.integer;
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    11
-            if (eptr->numlines < line_idx)
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    12
+            if (line_idx < 1 || line_idx > eptr->numlines)
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    13
                 return NULL;
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    14
         }
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    15
         return eptr;
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    16
@@ -1305,6 +1305,10 @@ handle_nsExtendOutput2Table(netsnmp_mib_handler          *handler,
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    17
                  * Determine which line we've been asked for....
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    18
                  */
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    19
                 line_idx = *table_info->indexes->next_variable->val.integer;
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    20
+                if (line_idx < 1 || line_idx > extension->numlines) {
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    21
+                    netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    22
+                    continue;
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    23
+                }
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    24
                 cp  = extension->lines[line_idx-1];
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    25
 
36b59963fa00 19616465 problem in UTILITY/NET-SNMP
Tomas Klacko <tomas.klacko@oracle.com>
parents:
diff changeset
    26
                 /*