From 792f5b3f2247a694abc9efb2017c610fa31737cd Mon Sep 17 00:00:00 2001 From: fbernon Date: Sat, 9 Jun 2007 10:36:21 +0000 Subject: [PATCH] Patch from Jared Momose (j.momose@ieee.org) for bug #19699 : "Bug in SNMP ASN1 decode; submitted patch" --- src/core/snmp/asn1_dec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/snmp/asn1_dec.c b/src/core/snmp/asn1_dec.c index 5e04b38e..eec4380e 100644 --- a/src/core/snmp/asn1_dec.c +++ b/src/core/snmp/asn1_dec.c @@ -333,7 +333,12 @@ snmp_asn1_dec_s32t(struct pbuf *p, u16_t ofs, u16_t len, s32_t *value) { u16_t plen, base; u8_t *msg_ptr; +#if BYTE_ORDER == LITTLE_ENDIAN u8_t *lsb_ptr = (u8_t*)value; +#endif +#if BYTE_ORDER == BIG_ENDIAN + u8_t *lsb_ptr = (u8_t*)value + sizeof(s32_t) - 1; +#endif u8_t sign; plen = 0;