From 1596980b426c22c7ec070fc097ae33832292f186 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 3 Oct 2011 09:23:37 +0000 Subject: [PATCH] [packages_10.03.1] merge r28358 SVN-Revision: 28359 --- net/mini_snmpd/Makefile | 2 +- .../102-mib_fix_uninitialized_memory.patch | 34 +++++++++++++++++++ .../103-mib_encode_snmp_element_oid_fix.patch | 4 +-- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 net/mini_snmpd/patches/102-mib_fix_uninitialized_memory.patch diff --git a/net/mini_snmpd/Makefile b/net/mini_snmpd/Makefile index a1fe691c28..ecc27177f9 100644 --- a/net/mini_snmpd/Makefile +++ b/net/mini_snmpd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mini_snmpd PKG_VERSION:=1.2b -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://members.aon.at/linuxfreak/linux/ diff --git a/net/mini_snmpd/patches/102-mib_fix_uninitialized_memory.patch b/net/mini_snmpd/patches/102-mib_fix_uninitialized_memory.patch new file mode 100644 index 0000000000..fc8cecf2e5 --- /dev/null +++ b/net/mini_snmpd/patches/102-mib_fix_uninitialized_memory.patch @@ -0,0 +1,34 @@ +--- a/mib.c ++++ b/mib.c +@@ -290,6 +290,7 @@ static int mib_build_entry(const oid_t * + value->data.max_length = sizeof (int) + 2; + value->data.encoded_length = 0; + value->data.buffer = malloc(value->data.max_length); ++ memset(value->data.buffer, 0, value->data.max_length); + if (encode_snmp_element_integer(value, (int)default_value) == -1) { + return -1; + } +@@ -298,6 +299,7 @@ static int mib_build_entry(const oid_t * + value->data.max_length = strlen((const char *)default_value) + 4; + value->data.encoded_length = 0; + value->data.buffer = malloc(value->data.max_length); ++ memset(value->data.buffer, 0, value->data.max_length); + if (encode_snmp_element_string(value, (const char *)default_value) == -1) { + return -1; + } +@@ -306,6 +308,7 @@ static int mib_build_entry(const oid_t * + value->data.max_length = MAX_NR_SUBIDS * 5 + 4; + value->data.encoded_length = 0; + value->data.buffer = malloc(value->data.max_length); ++ memset(value->data.buffer, 0, value->data.max_length); + if (encode_snmp_element_oid(value, oid_aton((const char *)default_value)) == -1) { + return -1; + } +@@ -316,6 +319,7 @@ static int mib_build_entry(const oid_t * + value->data.max_length = sizeof (unsigned int) + 2; + value->data.encoded_length = 0; + value->data.buffer = malloc(value->data.max_length); ++ memset(value->data.buffer, 0, value->data.max_length); + if (encode_snmp_element_unsigned(value, type, (unsigned int)default_value) == -1) { + return -1; + } diff --git a/net/mini_snmpd/patches/103-mib_encode_snmp_element_oid_fix.patch b/net/mini_snmpd/patches/103-mib_encode_snmp_element_oid_fix.patch index be4361c857..a1f105cb4a 100644 --- a/net/mini_snmpd/patches/103-mib_encode_snmp_element_oid_fix.patch +++ b/net/mini_snmpd/patches/103-mib_encode_snmp_element_oid_fix.patch @@ -10,9 +10,9 @@ buffer = value->data.buffer; length = 1; for (i = 2; i < oid_value->subid_list_length; i++) { -@@ -307,6 +310,8 @@ static int mib_build_entry(const oid_t * - value->data.encoded_length = 0; +@@ -310,6 +313,8 @@ static int mib_build_entry(const oid_t * value->data.buffer = malloc(value->data.max_length); + memset(value->data.buffer, 0, value->data.max_length); if (encode_snmp_element_oid(value, oid_aton((const char *)default_value)) == -1) { + lprintf(LOG_ERR, "could not create MIB entry '%s.%d.%d': invalid oid '%s'\n", + oid_ntoa(prefix), column, row, (char *)default_value); -- 2.30.2