Commit 49f510fe authored by Lev Walkin's avatar Lev Walkin

memory problem

parent 7b182846
...@@ -103,18 +103,25 @@ uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, ...@@ -103,18 +103,25 @@ uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
rv = td->uper_decoder(ctx, td, constraints, sptr, &spd); rv = td->uper_decoder(ctx, td, constraints, sptr, &spd);
asn_debug_indent -= 4; asn_debug_indent -= 4;
FREEMEM(buf); if(rv.code == RC_OK) {
/* Check padding validity */ /* Check padding validity */
padding = spd.nbits - spd.nboff; padding = spd.nbits - spd.nboff;
if(padding < 8 && per_get_few_bits(&spd, padding) == 0) {
/* Everything is cool */
FREEMEM(buf);
return rv;
}
FREEMEM(buf);
if(padding >= 8) { if(padding >= 8) {
ASN_DEBUG("Too large padding %d in open type", padding); ASN_DEBUG("Too large padding %d in open type", padding);
_ASN_DECODE_FAILED; _ASN_DECODE_FAILED;
} else if(per_get_few_bits(&spd, padding)) { } else {
/* Can't be "no more data", then it's non-zero padding */
ASN_DEBUG("Non-zero padding"); ASN_DEBUG("Non-zero padding");
_ASN_DECODE_FAILED; _ASN_DECODE_FAILED;
} }
} else {
FREEMEM(buf);
}
return rv; return rv;
} }
......
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