Commit 75b6fe4c authored by Lev Walkin's avatar Lev Walkin

make junking check work

parent 4ccce3da
......@@ -43,7 +43,13 @@ OPEN_TYPE_ber_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void *inner_value;
asn_dec_rval_t rv;
if(!(elm->flags & ATF_OPEN_TYPE) || !elm->type_selector) {
if(!(elm->flags & ATF_OPEN_TYPE)) {
ASN__DECODE_FAILED;
}
if(!elm->type_selector) {
ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
td->name, elm->name, elm->type->name);
ASN__DECODE_FAILED;
}
......@@ -126,7 +132,13 @@ OPEN_TYPE_xer_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
ssize_t ch_size;
pxer_chunk_type_e ch_type;
if(!(elm->flags & ATF_OPEN_TYPE) || !elm->type_selector) {
if(!(elm->flags & ATF_OPEN_TYPE)) {
ASN__DECODE_FAILED;
}
if(!elm->type_selector) {
ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
td->name, elm->name, elm->type->name);
ASN__DECODE_FAILED;
}
......@@ -278,7 +290,13 @@ OPEN_TYPE_uper_get(asn_codec_ctx_t *opt_codec_ctx,
void *inner_value;
asn_dec_rval_t rv;
if(!(elm->flags & ATF_OPEN_TYPE) || !elm->type_selector) {
if(!(elm->flags & ATF_OPEN_TYPE)) {
ASN__DECODE_FAILED;
}
if(!elm->type_selector) {
ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
td->name, elm->name, elm->type->name);
ASN__DECODE_FAILED;
}
......
......@@ -18,7 +18,14 @@ OPEN_TYPE_oer_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
asn_dec_rval_t rv;
size_t ot_ret;
if(!(elm->flags & ATF_OPEN_TYPE) || !elm->type_selector) {
if(!(elm->flags & ATF_OPEN_TYPE)) {
ASN__DECODE_FAILED;
}
if(!elm->type_selector) {
ASN_DEBUG("Type selector is not defined for Open Type %s->%s->%s",
td->name, elm->name, elm->type->name);
ASN__DECODE_FAILED;
}
......
......@@ -410,7 +410,7 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
/*
* Invoke the member fetch routine according to member's type
*/
if((elements[edx].flags & ATF_OPEN_TYPE) && elements[edx].type_selector) {
if(elements[edx].flags & ATF_OPEN_TYPE) {
rval = OPEN_TYPE_ber_get(opt_codec_ctx, td, st, &elements[edx], ptr, LEFT);
} else {
rval = elements[edx].type->op->ber_decoder(opt_codec_ctx,
......@@ -677,7 +677,7 @@ SEQUENCE_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
memb_ptr2 = &memb_ptr;
}
if((elm->flags & ATF_OPEN_TYPE) && elm->type_selector) {
if(elm->flags & ATF_OPEN_TYPE) {
tmprval = OPEN_TYPE_xer_get(opt_codec_ctx, td, st, elm, ptr, size);
} else {
/* Invoke the inner type decoder, m.b. multiple times */
......@@ -1140,7 +1140,7 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
/* Fetch the member from the stream */
ASN_DEBUG("Decoding member \"%s\" in %s", elm->name, td->name);
if((elm->flags & ATF_OPEN_TYPE) && elm->type_selector) {
if(elm->flags & ATF_OPEN_TYPE) {
rv = OPEN_TYPE_uper_get(opt_codec_ctx, td, st, elm, pd);
} else {
rv = elm->type->op->uper_decoder(opt_codec_ctx, elm->type,
......
......@@ -254,10 +254,12 @@ uper_open_type_get(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
int
uper_open_type_skip(asn_codec_ctx_t *ctx, asn_per_data_t *pd) {
asn_TYPE_descriptor_t s_td;
asn_TYPE_operation_t s_op;
asn_dec_rval_t rv;
s_td.name = "<unknown extension>";
s_td.op->uper_decoder = uper_sot_suck;
s_td.op = &s_op;
s_op.uper_decoder = uper_sot_suck;
rv = uper_open_type_get(ctx, &s_td, 0, 0, pd);
if(rv.code != RC_OK)
......
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