protect from SET OF NULL compression bomb
diff --git a/skeletons/constr_SET_OF.c b/skeletons/constr_SET_OF.c
index 2e253c9..a55e57a 100644
--- a/skeletons/constr_SET_OF.c
+++ b/skeletons/constr_SET_OF.c
@@ -964,8 +964,13 @@
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 */