From 4e583dab2e00c1bae057e97a9a7595241d8692a9 Mon Sep 17 00:00:00 2001 From: christiaans Date: Fri, 13 Oct 2006 13:45:06 +0000 Subject: [PATCH] Again, fixed decoding of negative integers in snmp_asn1_dec_s32t(), tnx to though testing by Sander. --- src/core/snmp/asn1_dec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/snmp/asn1_dec.c b/src/core/snmp/asn1_dec.c index 48833d63..fcc0888e 100644 --- a/src/core/snmp/asn1_dec.c +++ b/src/core/snmp/asn1_dec.c @@ -366,12 +366,14 @@ snmp_asn1_dec_s32t(struct pbuf *p, u16_t ofs, u16_t len, s32_t *value) if (sign) { *lsb_ptr &= *msg_ptr; + *value <<= 8; + *lsb_ptr |= 255; } else { *lsb_ptr |= *msg_ptr; + *value <<= 8; } - *value <<= 8; ofs += 1; if (ofs >= plen) {