components/net-snmp/patches/050.19616465.patch
author Tomas Klacko <tomas.klacko@oracle.com>
Thu, 18 Sep 2014 09:45:43 -0700
changeset 2095 36b59963fa00
permissions -rw-r--r--
19616465 problem in UTILITY/NET-SNMP
http://sourceforge.net/p/net-snmp/code/ci/4c5633f1603e4bd03ed05c37d782ec8911759c47/

diff --git a/agent/mibgroup/agent/extend.c b/agent/mibgroup/agent/extend.c
index 00d270a..cd0b2d6 100644
--- a/agent/mibgroup/agent/extend.c
+++ b/agent/mibgroup/agent/extend.c
@@ -1132,7 +1132,7 @@ _extend_find_entry( netsnmp_request_info       *request,
              * ...and check the line requested is valid
              */
             line_idx = *table_info->indexes->next_variable->val.integer;
-            if (eptr->numlines < line_idx)
+            if (line_idx < 1 || line_idx > eptr->numlines)
                 return NULL;
         }
         return eptr;
@@ -1305,6 +1305,10 @@ handle_nsExtendOutput2Table(netsnmp_mib_handler          *handler,
                  * Determine which line we've been asked for....
                  */
                 line_idx = *table_info->indexes->next_variable->val.integer;
+                if (line_idx < 1 || line_idx > extension->numlines) {
+                    netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
                 cp  = extension->lines[line_idx-1];
 
                 /*