Skip to content

Commit

Permalink
Fix UPER encoding of empty SEQUENCE OF
Browse files Browse the repository at this point in the history
A length determinant was not added when the SEQUENCE OF was empty
according to the X.691 #20.6 and #11.9.4.1.

This fixes a failure in 16-SEQUENCE-bundle

Decoding 1 bytes of T yielded RC_WMORE after byte 0
Original random structure:
T ::= {
    list: list ::= {
    }
    guard: 01
}
  • Loading branch information
velichkov authored and vlm committed Oct 26, 2017
1 parent 5fcbb28 commit abb7133
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions skeletons/constr_SEQUENCE_OF.c
Expand Up @@ -183,6 +183,14 @@ SEQUENCE_OF_encode_uper(const asn_TYPE_descriptor_t *td,
ct->effective_bits))
ASN__ENCODE_FAILED;
}
} else if (list->count == 0) {
/* When the list is empty add only the length determinant
* X.691, #20.6 and #11.9.4.1
*/
if (uper_put_length(po, 0, 0)) {
ASN__ENCODE_FAILED;
}
ASN__ENCODED_OK(er);
}


Expand Down

0 comments on commit abb7133

Please sign in to comment.