#include <mono/metadata/mempool-internals.h>
#include <mono/metadata/security-core-clr.h>
#include <mono/metadata/debug-helpers.h>
+#include <mono/metadata/verify-internals.h>
#include <mono/utils/mono-string.h>
#include <mono/utils/mono-error-internals.h>
mono_class_init (method->klass);
+ if (!mono_verifier_verify_cattr_content (image, method, data, len, NULL))
+ return NULL;
+
if (len == 0) {
attr = mono_object_new (mono_domain_get (), method->klass);
mono_runtime_invoke (method, attr, NULL, NULL);
guint32 i, j, num_named;
CattrNamedArg *arginfo = NULL;
+ if (!mono_verifier_verify_cattr_content (image, method, data, len, NULL))
+ return;
+
mono_class_init (method->klass);
*typed_args = NULL;
g_free (ainfo);
return NULL;
}
+
+ if (!mono_verifier_verify_cattr_blob (image, cols [MONO_CUSTOM_ATTR_VALUE], NULL)) {
+ /*FIXME raising an exception here doesn't make any sense*/
+ g_warning ("Invalid custom attribute blob on image %s for index %x", image->name, idx);
+ g_free (ainfo);
+ g_free (list);
+ return NULL;
+ }
data = mono_metadata_blob_heap (image, cols [MONO_CUSTOM_ATTR_VALUE]);
ainfo->attrs [i].data_size = mono_metadata_decode_value (data, &data);
ainfo->attrs [i].data = (guchar*)data;