bsnmp: add asn1 message length validation

admbugs:	780
Submitted by:	Guido Vranken, bz
Reported by:	Guido Vranken
Security:	CVE-2019-5610
This commit is contained in:
Ed Maste 2019-08-06 16:09:06 +00:00
parent ab7de25c25
commit 54e9e4e72d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=350635

View file

@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_len_t *len)
*len = *b->asn_cptr++;
b->asn_len--;
}
if (*len > b->asn_len) {
asn_error(b, "len %u exceeding asn_len %u", *len, b->asn_len);
return (ASN_ERR_EOBUF);
}
return (ASN_ERR_OK);
}