Skip to content

Commit

Permalink
MFC r350635: bsnmp: add asn1 message length validation
Browse files Browse the repository at this point in the history
admbugs:	780
Submitted by:	Guido Vranken, bz
Reported by:	Guido Vranken
Approved by:	so
Security:       CVE-2019-5610
  • Loading branch information
emaste committed Aug 6, 2019
1 parent af0383b commit be804d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contrib/bsnmp/lib/asn1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit be804d7

Please sign in to comment.