From bf1cab5bf8fb9b917b53c21fe2ed2aa2ab9be6d1 Mon Sep 17 00:00:00 2001 From: zoltan Date: Thu, 11 Jun 2009 21:07:46 +0000 Subject: [PATCH] 2009-06-11 Zoltan Varga * reflection.c (add_custom_modifiers): Avoid reading invalid memory. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mono@135948 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- mono/metadata/ChangeLog | 2 ++ mono/metadata/reflection.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog index b43ab3655..e760893c9 100644 --- a/mono/metadata/ChangeLog +++ b/mono/metadata/ChangeLog @@ -4,6 +4,8 @@ 2009-06-11 Zoltan Varga + * reflection.c (add_custom_modifiers): Avoid reading invalid memory. + * threads.c (mono_thread_execute_interruption): Avoid creating the abort exception object while holding the synch_cs lock. diff --git a/mono/metadata/reflection.c b/mono/metadata/reflection.c index 3ade240e1..1e8fe1234 100644 --- a/mono/metadata/reflection.c +++ b/mono/metadata/reflection.c @@ -2899,7 +2899,7 @@ add_custom_modifiers (MonoDynamicImage *assembly, MonoType *type, MonoArray *mod len = sizeof (MonoType) + ((gint32)count - MONO_ZERO_LEN_ARRAY) * sizeof (MonoCustomMod); t = g_malloc (len); - memcpy (t, type, len); + memcpy (t, type, sizeof (MonoType)); t->num_mods = count; pos = 0; -- 2.11.4.GIT