bits unused constraint failure

git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@1276 59561ff5-6e30-0410-9f3c-9617f08c8826
This commit is contained in:
vlm 2007-02-21 19:27:45 +00:00
parent 1b91c61be8
commit 206313dde8
1 changed files with 2 additions and 1 deletions

View File

@ -50,7 +50,8 @@ BIT_STRING_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
if(st && st->buf) {
if(st->size == 1 && st->bits_unused) {
if((st->size == 0 && st->bits_unused)
|| st->bits_unused < 0 || st->bits_unused > 7) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: invalid padding byte (%s:%d)",
td->name, __FILE__, __LINE__);