Commit c8125d72 authored by Andrea Bigagli's avatar Andrea Bigagli Committed by Mouse

Fix: protect dereferencing pointer to asn_per_constraint_t

parent a6376b40
......@@ -52,11 +52,14 @@ CHOICE_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
} else {
if(specs->ext_start == -1)
ASN__DECODE_FAILED;
value = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound + 1);
if(value < 0) ASN__DECODE_STARVED;
value += specs->ext_start;
if((unsigned)value >= td->elements_count)
ASN__DECODE_FAILED;
if (ct && ct->upper_bound >= ct->lower_bound) {
value = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound + 1);
if(value < 0) ASN__DECODE_STARVED;
value += specs->ext_start;
if((unsigned)value >= td->elements_count)
ASN__DECODE_FAILED;
}
}
/* Adjust if canonical order is different from natural order */
......
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