From c1dc1a20d61798615a99065a8359ffc09d5b065a Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Thu, 20 Feb 2014 22:14:10 +0100 Subject: [PATCH] fixed bug #40050 SNMP problem with MIB arrays > 255 --- CHANGELOG | 3 +++ src/core/snmp/mib_structs.c | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index af7a5bf4..2682b9f4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -96,6 +96,9 @@ HISTORY ++ Bugfixes: + 2014-02-20: Simon Goldschmidt + * mib_structs.c: fixed bug #40050 SNMP problem with MIB arrays > 255 + 2014-02-20: Simon Goldschmidt * api.h, sockets.c: fixed bug #41499 netconn::recv_avail can overflow diff --git a/src/core/snmp/mib_structs.c b/src/core/snmp/mib_structs.c index 2f185cb4..67c1f941 100644 --- a/src/core/snmp/mib_structs.c +++ b/src/core/snmp/mib_structs.c @@ -737,13 +737,13 @@ snmp_expand_tree(struct mib_node *node, u8_t ident_len, s32_t *ident, struct snm } else { - u8_t j; + u16_t j; struct nse cur_node; LWIP_DEBUGF(SNMP_MIB_DEBUG,("non-leaf node\n")); /* non-leaf, store right child ptr and id */ LWIP_ASSERT("i < 0xff", i < 0xff); - j = (u8_t)i + 1; + j = i + 1; while ((j < an->maxlength) && (empty_table(an->nptr[j]))) { j++; @@ -781,7 +781,7 @@ snmp_expand_tree(struct mib_node *node, u8_t ident_len, s32_t *ident, struct snm } else { - u8_t j; + u16_t j; /* ident_len == 0, complete with leftmost '.thing' */ j = 0; while ((j < an->maxlength) && empty_table(an->nptr[j])) @@ -980,13 +980,13 @@ snmp_expand_tree(struct mib_node *node, u8_t ident_len, s32_t *ident, struct snm } else { - u8_t j; + u16_t j; struct nse cur_node; LWIP_DEBUGF(SNMP_MIB_DEBUG,("non-leaf node\n")); /* non-leaf, store right child ptr and id */ LWIP_ASSERT("i < 0xff", i < 0xff); - j = (u8_t)i + 1; + j = i + 1; if (j < len) { /* right node is the current external node */