Commit 5b314f76 authored by Mouse's avatar Mouse

Minimal fix to address #40, applying parts of #41

parent b23abebe
......@@ -1802,7 +1802,7 @@ OCTET_STRING_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
(long)csiz->effective_bits, (long)raw_len,
repeat ? "repeat" : "once", td->name);
if (raw_len > 2) { /* X.691 #16 NOTE 1 */
if ((raw_len > 2) || (csiz->upper_bound > 2)) { /* X.691 #16 NOTE 1 */
if (aper_get_align(pd) < 0)
RETURN(RC_FAIL);
}
......@@ -1956,7 +1956,7 @@ OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
ret = aper_put_length(po, csiz->upper_bound - csiz->lower_bound + 1, sizeinunits - csiz->lower_bound);
if(ret) ASN__ENCODE_FAILED;
}
if (st->size > 2) { /* X.691 #16 NOTE 1 */
if ((st->size > 2) || (csiz->upper_bound > 2)) { /* X.691 #16 NOTE 1 */
if (aper_put_align(po) < 0)
ASN__ENCODE_FAILED;
}
......
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