summaryrefslogtreecommitdiffstats
path: root/main/net-snmp
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2015-02-23 09:37:34 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2015-02-23 09:38:22 +0000
commit287f3b6a4204a6f89ea28eb441eab17c4550a63b (patch)
treeaa18a6e99ee5d323ad6f084b71a6b4276e456b32 /main/net-snmp
parent5c262e42bd69c61ae9f25ce6d32aaa4f7f673a06 (diff)
downloadaports-287f3b6a4204a6f89ea28eb441eab17c4550a63b.tar.bz2
aports-287f3b6a4204a6f89ea28eb441eab17c4550a63b.tar.xz
main/net-snmp: upgrade to 5.7.3
Diffstat (limited to 'main/net-snmp')
-rw-r--r--main/net-snmp/APKBUILD20
-rw-r--r--main/net-snmp/net-snmp-CVE-2014-3565.patch446
-rw-r--r--main/net-snmp/netsnmp-swinst-crash.patch23
3 files changed, 20 insertions, 469 deletions
diff --git a/main/net-snmp/APKBUILD b/main/net-snmp/APKBUILD
index 24f9989c7..50acba0bd 100644
--- a/main/net-snmp/APKBUILD
+++ b/main/net-snmp/APKBUILD
@@ -1,8 +1,8 @@
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=net-snmp
-pkgver=5.7.2.1
-pkgrel=4
+pkgver=5.7.3
+pkgrel=0
pkgdesc="Simple Network Management Protocol"
url="http://www.net-snmp.org/"
arch="all"
@@ -17,7 +17,6 @@ subpackages="$pkgname-doc $pkgname-dev $pkgname-libs $pkgname-agent-libs:alibs
source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
netsnmp-swinst-crash.patch
fix-includes.patch
- net-snmp-CVE-2014-3565.patch
snmpd.initd
snmpd.confd
snmptrapd.initd
@@ -155,26 +154,23 @@ tools() {
}
-md5sums="7db683faba037249837b226f64d566d4 net-snmp-5.7.2.1.tar.gz
-bd7dc10ffb5839e35ec37effcc53c2ad netsnmp-swinst-crash.patch
+md5sums="d4a3459e1577d0efa8d96ca70a885e53 net-snmp-5.7.3.tar.gz
+4fd189ec7154114c9bd19f2b0058ae9c netsnmp-swinst-crash.patch
0fe11859a55f8e2489d5de629971a242 fix-includes.patch
-f43a7fef62333882a977acb9e211047c net-snmp-CVE-2014-3565.patch
3676e4d2e456e88da0dee8d7204749ba snmpd.initd
ea1296c366d6a7b0dab8a5b46e02d139 snmpd.confd
7ce3e9e880fc6313ae87eb000bae4bda snmptrapd.initd
363f7728a76bdfc46e29b7e1f5cf4950 snmptrapd.confd"
-sha256sums="35dd20a2b17849f6d5a0a6109b4f52c1a777a3e1a00c79c4a175c520d23f3497 net-snmp-5.7.2.1.tar.gz
-377e54bc2b66590c1c5174bf2e2c820adcbecd703d67c68be13c325d04d7d0c4 netsnmp-swinst-crash.patch
+sha256sums="12ef89613c7707dc96d13335f153c1921efc9d61d3708ef09f3fc4a7014fb4f0 net-snmp-5.7.3.tar.gz
+2de23959acf74d8f893129819149d016cc22f2d60e15f875e4d17de33931013e netsnmp-swinst-crash.patch
7528f7d368a0a4536915805c065f8496c37cb99dbc74d508bed89831cd5af37e fix-includes.patch
-a7fd0c8db7428e15c8ffbbb105d651fbcc81ef69b2f587ceb8a10f6d00afc6da net-snmp-CVE-2014-3565.patch
0f36683e3ab9855ab16c6a9e7f5934145b7f65a02c3dd46dc9627b721296119a snmpd.initd
e1434b38611a436278b1f0974a55ea3374863a975405b5dc2da836e9acb082ff snmpd.confd
4baf3ee9950ded78078d93c32833ff657d7e85580d64778cdc9a963cf24bc7ab snmptrapd.initd
095647b0e5be51e2bdd398267d7450da678b7d23cae6273f9b9461a26f89d69f snmptrapd.confd"
-sha512sums="6c4dadd145cab9572e2559ad99d6794469685086771c6d757d3667da1a061ab86746d53c28d48381c59a90d92b1812b813f3176cff156c41929177fb585299d0 net-snmp-5.7.2.1.tar.gz
-78c036f1e6b4e3592cb2a6ff9b22671c930e337e9644298a9f78b6f13af1d9241d9c15dcc996b441b51cb2d551bf2dfe5caf602ff1e17baf7b6532f3dc6ba5bd netsnmp-swinst-crash.patch
+sha512sums="0758bba5844cfd6c80959ac16b83906a2f830ba49fd0ab1bf9e191dc6a79d312a2e4760bd53b3e1a1c82759481f0064d088d5a3cf475d84b25679a6bd0f049bb net-snmp-5.7.3.tar.gz
+4ad92f50b14d5e27ba86256cc532a2dd055502f4d5fbb1700434f9f01f881fd09bb1eadb94e727554e1470f036707558314c64a66d0376b54e71ab31d5e4baa3 netsnmp-swinst-crash.patch
87a552bd2e41684bba6e87fbcf6454a85ee912d7a339411fda24cebddf7661f0856729e076a917920a542cf84b687ffd90a091daa15f2c48f0ff64f3a53c0ddb fix-includes.patch
-8c831ea115413aa1170532865c72cbc9e6e3344b5739b1028095128d870689bcd1222a2fea6005760b80881212b0b92eba565e22fb03b037e1cb04d61378e2cc net-snmp-CVE-2014-3565.patch
887e84b775cd87a3631deac44aa35645c2df9b13b9346b2b23a80e513e82425304a79a8bf5234937f01638969788602539846e7fb8f9b5a9273c938a6233a175 snmpd.initd
ad30bb027dbd18272a4ddb34009bdaa19df030f23956c5fa592e47cf76ad87175ae6b97659b8bbd866d79674bbc7b8b3a8a400746139c18de0eb86902706b65f snmpd.confd
e9b29b89d27e88420932ea6ca077a6c807ae5555436cad4d840ec732b5851a498661d0d174f22d308f403904b623d7eadf9d201a539529ff57ced18bc8c58b6f snmptrapd.initd
diff --git a/main/net-snmp/net-snmp-CVE-2014-3565.patch b/main/net-snmp/net-snmp-CVE-2014-3565.patch
deleted file mode 100644
index 86af4a03d..000000000
--- a/main/net-snmp/net-snmp-CVE-2014-3565.patch
+++ /dev/null
@@ -1,446 +0,0 @@
-commit 7f4a7b891332899cea26e95be0337aae01648742
-Author: Jan Safranek <jsafranek@users.sourceforge.net>
-Date: Thu Jul 31 13:46:49 2014 +0200
-
- Added checks for printing variables with wrong types.
-
- When -OQ command line argument is used, variable formatter preffers the type
- of the varible parsed from a MIB file instead of checking type of the variable
- as parsed from SNMP message.
-
- This can lead to crashes when incoming packets contains a variable with
- NULL type, while the MIB says the variable should be non-NULL, like Integer.
- The formatter then tries to interpret the NULL (from packet) as Integer (from
- MIB file).
-
-diff --git a/snmplib/mib.c b/snmplib/mib.c
-index 9d3ca41..c6e0010 100644
---- a/snmplib/mib.c
-+++ b/snmplib/mib.c
-@@ -439,17 +439,16 @@ sprint_realloc_octet_string(u_char ** buf, size_t * buf_len,
- u_char *cp;
- int output_format, cnt;
-
-- 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;
-- }
- }
-
-
-@@ -702,16 +701,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)) {
-@@ -772,17 +771,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)) {
-@@ -847,20 +845,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)) {
-@@ -948,23 +947,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:
-@@ -1040,17 +1041,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)) {
-@@ -1110,16 +1110,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)) {
-@@ -1277,17 +1277,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;
-@@ -1380,16 +1381,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) {
-@@ -1477,17 +1478,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)) {
-@@ -1550,16 +1550,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)) {
-@@ -1613,16 +1613,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)) {
-@@ -1679,16 +1679,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)) {
-@@ -1737,20 +1737,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);
- }
-
-
-@@ -1785,16 +1785,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)) {
-@@ -1869,16 +1869,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)) {
diff --git a/main/net-snmp/netsnmp-swinst-crash.patch b/main/net-snmp/netsnmp-swinst-crash.patch
index 5502ddb28..58c368fac 100644
--- a/main/net-snmp/netsnmp-swinst-crash.patch
+++ b/main/net-snmp/netsnmp-swinst-crash.patch
@@ -1,12 +1,13 @@
---- net-snmp-5.7.1/agent/mibgroup/host/data_access/swinst_pkginfo.c
-+++ /home/fabled//net-snmp-5.7.1.patched/agent/mibgroup/host/data_access/swinst_pkginfo.c
-@@ -140,7 +140,8 @@
- memcpy( entry->swDate, cp, date_len );
- entry->swDate_len = date_len;
+--- a/agent/mibgroup/host/data_access/swinst_pkginfo.c.orig
++++ b/agent/mibgroup/host/data_access/swinst_pkginfo.c
+@@ -207,7 +207,9 @@
+ memcpy( entry->swDate, cp, date_len );
+ entry->swDate_len = date_len;
+ }
+- closedir( d );
++ if (d != NULL)
++ closedir( d );
++
+ #ifdef HAVE_LIBPKG
}
-- closedir( d );
-+ if (d != NULL)
-+ closedir( d );
-
- DEBUGMSGTL(("swinst:load:arch"," loaded %d entries\n",
- (int)CONTAINER_SIZE(container)));
+ #endif