components/net-snmp/patches/050.19616465.patch
changeset 2095 36b59963fa00
equal deleted inserted replaced
2094:37705edf6dec 2095:36b59963fa00
       
     1 http://sourceforge.net/p/net-snmp/code/ci/4c5633f1603e4bd03ed05c37d782ec8911759c47/
       
     2 
       
     3 diff --git a/agent/mibgroup/agent/extend.c b/agent/mibgroup/agent/extend.c
       
     4 index 00d270a..cd0b2d6 100644
       
     5 --- a/agent/mibgroup/agent/extend.c
       
     6 +++ b/agent/mibgroup/agent/extend.c
       
     7 @@ -1132,7 +1132,7 @@ _extend_find_entry( netsnmp_request_info       *request,
       
     8               * ...and check the line requested is valid
       
     9               */
       
    10              line_idx = *table_info->indexes->next_variable->val.integer;
       
    11 -            if (eptr->numlines < line_idx)
       
    12 +            if (line_idx < 1 || line_idx > eptr->numlines)
       
    13                  return NULL;
       
    14          }
       
    15          return eptr;
       
    16 @@ -1305,6 +1305,10 @@ handle_nsExtendOutput2Table(netsnmp_mib_handler          *handler,
       
    17                   * Determine which line we've been asked for....
       
    18                   */
       
    19                  line_idx = *table_info->indexes->next_variable->val.integer;
       
    20 +                if (line_idx < 1 || line_idx > extension->numlines) {
       
    21 +                    netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
       
    22 +                    continue;
       
    23 +                }
       
    24                  cp  = extension->lines[line_idx-1];
       
    25  
       
    26                  /*