19547764 problem in UTILITY/NET-SNMP s11-update
authorTomas Klacko <tomas.klacko@oracle.com>
Thu, 30 Oct 2014 12:03:11 -0700
branchs11-update
changeset 3440 573f3b6b1987
parent 3435 25a421888935
child 3441 94245073f21f
19547764 problem in UTILITY/NET-SNMP 19616465 problem in UTILITY/NET-SNMP 19616471 problem in UTILITY/NET-SNMP
components/net-snmp/patches/049.19547764.patch
components/net-snmp/patches/050.19616465.patch
components/net-snmp/patches/051.19616471.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/net-snmp/patches/049.19547764.patch	Thu Oct 30 12:03:11 2014 -0700
@@ -0,0 +1,434 @@
+http://sourceforge.net/p/net-snmp/official-patches/48
+http://sourceforge.net/p/net-snmp/code/ci/7f4a7b891332899cea26e95be0337aae01648742
+
+diff --git a/snmplib/mib.c b/snmplib/mib.c
+index b0a7d29..e2fd906 100644
+--- a/snmplib/mib.c
++++ b/snmplib/mib.c
+@@ -436,17 +436,16 @@ sprint_realloc_octet_string(u_char ** buf, size_t * buf_len,
+     u_char         *cp;
+     int             output_format;
+ 
+-    if ((var->type != ASN_OCTET_STR) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        const char      str[] = "Wrong Type (should be OCTET STRING): ";
+-        if (snmp_cstrcat
+-            (buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_OCTET_STR) {
++        if (!netsnmp_ds_get_boolean(
++                    NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            const char      str[] = "Wrong Type (should be OCTET STRING): ";
++            if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+ 
+@@ -704,16 +703,16 @@ sprint_realloc_float(u_char ** buf, size_t * buf_len,
+                      const struct enum_list *enums,
+                      const char *hint, const char *units)
+ {
+-    if ((var->type != ASN_OPAQUE_FLOAT) &&
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, 
+-                         "Wrong Type (should be Float): ")) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_OPAQUE_FLOAT) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be Float): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -774,17 +773,16 @@ sprint_realloc_double(u_char ** buf, size_t * buf_len,
+                       const struct enum_list *enums,
+                       const char *hint, const char *units)
+ {
+-    if ((var->type != ASN_OPAQUE_DOUBLE) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        if (snmp_cstrcat
+-            (buf, buf_len, out_len, allow_realloc, 
+-             "Wrong Type (should be Double): ")) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_OPAQUE_DOUBLE) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be Double): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -849,20 +847,21 @@ sprint_realloc_counter64(u_char ** buf, size_t * buf_len, size_t * out_len,
+ {
+     char            a64buf[I64CHARSZ + 1];
+ 
+-    if ((var->type != ASN_COUNTER64
++    if (var->type != ASN_COUNTER64
+ #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+         && var->type != ASN_OPAQUE_COUNTER64
+         && var->type != ASN_OPAQUE_I64 && var->type != ASN_OPAQUE_U64
+ #endif
+-        ) && (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, 
+-                        "Wrong Type (should be Counter64): ")) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++        ) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be Counter64): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -950,23 +949,25 @@ sprint_realloc_opaque(u_char ** buf, size_t * buf_len,
+                       const struct enum_list *enums,
+                       const char *hint, const char *units)
+ {
+-    if ((var->type != ASN_OPAQUE
++    if (var->type != ASN_OPAQUE
+ #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+         && var->type != ASN_OPAQUE_COUNTER64
+         && var->type != ASN_OPAQUE_U64
+         && var->type != ASN_OPAQUE_I64
+         && var->type != ASN_OPAQUE_FLOAT && var->type != ASN_OPAQUE_DOUBLE
+ #endif                          /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+-        ) && (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, 
+-                         "Wrong Type (should be Opaque): ")) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++        ) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be Opaque): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
++
+ #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+     switch (var->type) {
+     case ASN_OPAQUE_COUNTER64:
+@@ -1042,17 +1043,16 @@ sprint_realloc_object_identifier(u_char ** buf, size_t * buf_len,
+ {
+     int             buf_overflow = 0;
+ 
+-    if ((var->type != ASN_OBJECT_ID) &&
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] =
+-            "Wrong Type (should be OBJECT IDENTIFIER): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_OBJECT_ID) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be OBJECT IDENTIFIER): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -1112,16 +1112,16 @@ sprint_realloc_timeticks(u_char ** buf, size_t * buf_len, size_t * out_len,
+ {
+     char            timebuf[40];
+ 
+-    if ((var->type != ASN_TIMETICKS) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be Timeticks): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_TIMETICKS) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be Timeticks): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NUMERIC_TIMETICKS)) {
+@@ -1260,17 +1260,18 @@ sprint_realloc_integer(u_char ** buf, size_t * buf_len, size_t * out_len,
+ {
+     char           *enum_string = NULL;
+ 
+-    if ((var->type != ASN_INTEGER) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be INTEGER): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_INTEGER) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be INTEGER): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
++
+     for (; enums; enums = enums->next) {
+         if (enums->value == *var->val.integer) {
+             enum_string = enums->label;
+@@ -1363,16 +1364,16 @@ sprint_realloc_uinteger(u_char ** buf, size_t * buf_len, size_t * out_len,
+ {
+     char           *enum_string = NULL;
+ 
+-    if ((var->type != ASN_UINTEGER) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be UInteger32): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_UINTEGER) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be UInteger32): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     for (; enums; enums = enums->next) {
+@@ -1460,17 +1461,16 @@ sprint_realloc_gauge(u_char ** buf, size_t * buf_len, size_t * out_len,
+ {
+     char            tmp[32];
+ 
+-    if ((var->type != ASN_GAUGE) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] =
+-            "Wrong Type (should be Gauge32 or Unsigned32): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_GAUGE) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be Gauge32 or Unsigned32): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -1533,16 +1533,16 @@ sprint_realloc_counter(u_char ** buf, size_t * buf_len, size_t * out_len,
+ {
+     char            tmp[32];
+ 
+-    if ((var->type != ASN_COUNTER) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be Counter32): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_COUNTER) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be Counter32): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -1596,16 +1596,16 @@ sprint_realloc_networkaddress(u_char ** buf, size_t * buf_len,
+ {
+     size_t          i;
+ 
+-    if ((var->type != ASN_IPADDRESS) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be NetworkAddress): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_IPADDRESS) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be NetworkAddress): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -1662,16 +1662,16 @@ sprint_realloc_ipaddress(u_char ** buf, size_t * buf_len, size_t * out_len,
+ {
+     u_char         *ip = var->val.string;
+ 
+-    if ((var->type != ASN_IPADDRESS) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be IpAddress): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_IPADDRESS) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be IpAddress): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -1720,20 +1720,20 @@ sprint_realloc_null(u_char ** buf, size_t * buf_len, size_t * out_len,
+                     const struct enum_list *enums,
+                     const char *hint, const char *units)
+ {
+-    if ((var->type != ASN_NULL) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be NULL): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_NULL) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be NULL): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+-    } else {
+-        u_char          str[] = "NULL";
+-        return snmp_strcat(buf, buf_len, out_len, allow_realloc, str);
+     }
++
++    u_char          str[] = "NULL";
++    return snmp_strcat(buf, buf_len, out_len, allow_realloc, str);
+ }
+ 
+ 
+@@ -1768,16 +1768,16 @@ sprint_realloc_bitstring(u_char ** buf, size_t * buf_len, size_t * out_len,
+     u_char         *cp;
+     char           *enum_string;
+ 
+-    if ((var->type != ASN_BIT_STR && var->type != ASN_OCTET_STR) &&
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be BITS): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_BIT_STR && var->type != ASN_OCTET_STR) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be BITS): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -1852,16 +1852,16 @@ sprint_realloc_nsapaddress(u_char ** buf, size_t * buf_len,
+                            const struct enum_list *enums, const char *hint,
+                            const char *units)
+ {
+-    if ((var->type != ASN_NSAP) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be NsapAddress): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_NSAP) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be NsapAddress): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/net-snmp/patches/050.19616465.patch	Thu Oct 30 12:03:11 2014 -0700
@@ -0,0 +1,26 @@
+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];
+ 
+                 /* 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/net-snmp/patches/051.19616471.patch	Thu Oct 30 12:03:11 2014 -0700
@@ -0,0 +1,31 @@
+http://sourceforge.net/p/net-snmp/code/ci/76e8d6d100320629d8a23be4b0128619600c919d/
+https://security-tracker.debian.org/tracker/CVE-2014-2285
+
+diff --git a/perl/TrapReceiver/TrapReceiver.xs b/perl/TrapReceiver/TrapReceiver.xs
+index d4ccac9..0ab1a81 100644
+--- a/perl/TrapReceiver/TrapReceiver.xs
++++ b/perl/TrapReceiver/TrapReceiver.xs
+@@ -73,18 +73,18 @@ int   perl_trapd_handler( netsnmp_pdu           *pdu,
+         STOREPDUi("securitymodel", pdu->securityModel);
+         STOREPDUi("securitylevel", pdu->securityLevel);
+         STOREPDU("contextName",
+-                 newSVpv(pdu->contextName, pdu->contextNameLen));
++                 newSVpv(pdu->contextName ? pdu->contextName : "", pdu->contextNameLen));
+         STOREPDU("contextEngineID",
+-                 newSVpv(pdu->contextEngineID,
++                 newSVpv(pdu->contextEngineID ? (char *) pdu->contextEngineID : "",
+                                     pdu->contextEngineIDLen));
+         STOREPDU("securityEngineID",
+-                 newSVpv(pdu->securityEngineID,
++                 newSVpv(pdu->securityEngineID ? (char *) pdu->securityEngineID : "",
+                                     pdu->securityEngineIDLen));
+         STOREPDU("securityName",
+-                 newSVpv(pdu->securityName, pdu->securityNameLen));
++                 newSVpv(pdu->securityName ? (char *) pdu->securityName : "", pdu->securityNameLen));
+     } else {
+         STOREPDU("community",
+-                 newSVpv(pdu->community, pdu->community_len));
++                 newSVpv(pdu->community ? (char *) pdu->community : "", pdu->community_len));
+     }
+ 
+     if (transport && transport->f_fmtaddr) {