Commit 02666199 authored by Lev Walkin's avatar Lev Walkin

better handling of not-yet-present extensions

parent b0f3db69
...@@ -764,12 +764,13 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ...@@ -764,12 +764,13 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
case XCT_UNKNOWN_OP: case XCT_UNKNOWN_OP:
case XCT_UNKNOWN_BO: case XCT_UNKNOWN_BO:
ASN_DEBUG("XER/SEQUENCE: tcv=%d, ph=%d", ASN_DEBUG("XER/SEQUENCE: tcv=%d, ph=%d, edx=%d",
tcv, ctx->phase); tcv, ctx->phase, edx);
if(ctx->phase != 1 if(ctx->phase != 1) {
|| edx >= td->elements_count)
break; /* Really unexpected */ break; /* Really unexpected */
}
if(edx < td->elements_count) {
/* /*
* Search which member corresponds to this tag. * Search which member corresponds to this tag.
*/ */
...@@ -778,7 +779,8 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ...@@ -778,7 +779,8 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
edx_end = td->elements_count; edx_end = td->elements_count;
for(n = edx; n < edx_end; n++) { for(n = edx; n < edx_end; n++) {
elm = &td->elements[n]; elm = &td->elements[n];
tcv = xer_check_tag(buf_ptr,ch_size,elm->name); tcv = xer_check_tag(buf_ptr,
ch_size, elm->name);
switch(tcv) { switch(tcv) {
case XCT_BOTH: case XCT_BOTH:
case XCT_OPENING: case XCT_OPENING:
...@@ -799,11 +801,17 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ...@@ -799,11 +801,17 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
} }
if(n != edx_end) if(n != edx_end)
continue; continue;
} else {
ASN_DEBUG("Out of defined members: %d/%d",
edx, td->elements_count);
}
/* It is expected extension */ /* It is expected extension */
if(IN_EXTENSION_GROUP(specs, if(IN_EXTENSION_GROUP(specs,
edx + elements[edx].optional)) { edx + (edx < td->elements_count
ASN_DEBUG("Got anticipated extension at %d", edx); ? elements[edx].optional : 0))) {
ASN_DEBUG("Got anticipated extension at %d",
edx);
/* /*
* Check for (XCT_BOTH or XCT_UNKNOWN_BO) * Check for (XCT_BOTH or XCT_UNKNOWN_BO)
* By using a mask. Only record a pure * By using a mask. Only record a pure
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment