[packages_10.03.1] merge r28358
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 3 Oct 2011 09:23:37 +0000 (09:23 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 3 Oct 2011 09:23:37 +0000 (09:23 +0000)
SVN-Revision: 28359

net/mini_snmpd/Makefile
net/mini_snmpd/patches/102-mib_fix_uninitialized_memory.patch [new file with mode: 0644]
net/mini_snmpd/patches/103-mib_encode_snmp_element_oid_fix.patch

index a1fe691..ecc2717 100644 (file)
@@ -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 (file)
index 0000000..fc8cecf
--- /dev/null
@@ -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;
+                       }
index be4361c..a1f105c 100644 (file)
@@ -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);