Commit 7156898e authored by Lev Walkin's avatar Lev Walkin

protect from SET OF NULL compression bomb

parent d8e6bbfa
......@@ -964,8 +964,13 @@ SET_OF_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
ASN_DEBUG("%s SET OF %s decoded %d, %p",
td->name, elm->type->name, rv.code, ptr);
if(rv.code == RC_OK) {
if(ASN_SET_ADD(list, ptr) == 0)
if(ASN_SET_ADD(list, ptr) == 0) {
if(rv.consumed == 0 && nelems > 200) {
/* Protect from SET OF NULL compression bombs. */
ASN__DECODE_FAILED;
}
continue;
}
ASN_DEBUG("Failed to add element into %s",
td->name);
/* Fall through */
......
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