mirror of https://gerrit.osmocom.org/asn1c
Fix UPER encoding of empty SEQUENCE OF
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 }
This commit is contained in:
parent
5fcbb2868d
commit
abb7133c23
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue