return -1;
}
+ /*
+ * Limit the length of the data to be decoded.
+ */
+ fr_dbuff_set_end(&our_in, fr_dbuff_current(&our_in) + len);
+
if (flags->is_extensions) {
slen = fr_der_decode_x509_extensions(ctx, out, &our_in, parent, decode_ctx);
if (slen <= 0) return slen;
func = &type_funcs[parent->type];
if (!func->decode) func = &tag_funcs[tag];
fr_assert(func != NULL);
+ fr_assert(func->decode != NULL);
/*
* Enforce limits on min/max.
break;
}
- /*
- * Limit the length of the data to be decoded.
- */
- fr_dbuff_set_end(&our_in, fr_dbuff_current(&our_in) + len);
-
- fr_assert(func->decode != NULL);
-
/*
* The decode function can return 0 if len==0. This is true for 'null' data types, and
* for variable-sized types such as strings.