From f198b11f2799e21ff1bf885dc6eb771d9d4d69a8 Mon Sep 17 00:00:00 2001 From: christiaans Date: Thu, 17 Aug 2006 14:09:57 +0000 Subject: [PATCH] Accepting zero length identifiers e.g. for getnext operation. Uncommon but valid. --- src/core/snmp/asn1_dec.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/snmp/asn1_dec.c b/src/core/snmp/asn1_dec.c index 52f753f5..7c8bbade 100644 --- a/src/core/snmp/asn1_dec.c +++ b/src/core/snmp/asn1_dec.c @@ -470,10 +470,9 @@ snmp_asn1_dec_oid(struct pbuf *p, u16_t ofs, u16_t len, struct snmp_obj_id *oid) } else { - /* length == 0, zero length (empty list) isn't allowed here. - ISO 8825 (BER) isn't clear about this, but some seem to accept it (why?). - zeroDotZero (0.0) must be at least 06 01 00 */ - return ERR_ARG; + /* accepting zero length identifiers e.g. for + getnext operation. uncommon but valid */ + return ERR_OK; } len--; if (len > 0)