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
}
diff --git a/skeletons/constr_SEQUENCE_OF.c b/skeletons/constr_SEQUENCE_OF.c
index 997350a..63893c7 100644
--- a/skeletons/constr_SEQUENCE_OF.c
+++ b/skeletons/constr_SEQUENCE_OF.c
@@ -183,6 +183,14 @@
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);
}