mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-29 12:14:28 +00:00
Fixed encoding of object sub identifiers with trailing zero.
This commit is contained in:
parent
473e567047
commit
c2f9d7dee0
@ -490,19 +490,20 @@ snmp_asn1_enc_oid(struct pbuf *p, u16_t ofs, u8_t ident_len, s32_t *ident)
|
||||
while (ident_len > 0)
|
||||
{
|
||||
s32_t sub_id;
|
||||
u8_t shift;
|
||||
u8_t shift, tail;
|
||||
|
||||
ident_len--;
|
||||
sub_id = *ident;
|
||||
|
||||
tail = 0;
|
||||
shift = 28;
|
||||
while(shift > 0)
|
||||
{
|
||||
u8_t code;
|
||||
|
||||
code = sub_id >> shift;
|
||||
if (code != 0)
|
||||
if ((code != 0) || (tail != 0))
|
||||
{
|
||||
tail = 1;
|
||||
*msg_ptr = code | 0x80;
|
||||
ofs += 1;
|
||||
if (ofs >= plen)
|
||||
|
Loading…
Reference in New Issue
Block a user