2009-01-09 Rodrigo Kumpera <rkumpera@novell.com>
authorRodrigo Kumpera <kumpera@gmail.com>
Mon, 12 Jan 2009 13:58:03 +0000 (13:58 -0000)
committerRodrigo Kumpera <kumpera@gmail.com>
Mon, 12 Jan 2009 13:58:03 +0000 (13:58 -0000)
* metadata-verify.c: Add lfanew verification.

svn path=/trunk/mono/; revision=123062

mono/metadata/ChangeLog
mono/metadata/metadata-verify.c

index c762417241e90128dc530150104590e407cfb2ea..b7630984cce145b32ffd62ab99e40923284049ec 100644 (file)
@@ -1,32 +1,6 @@
-2009-01-12  Jb Evain  <jbevain@novell.com>
-
-       * tabldefs.h: rename METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE to
-       METHOD_ATTRIBUTE_STRICT to match the ECMA terminology.
-
-2009-01-10  Zoltan Varga  <vargaz@gmail.com>
-
-       * socket-io.c: Fix the build.
-
-       * environment.c: Fix an #ifdef.
-
-2009-01-09  Zoltan Varga  <vargaz@gmail.com>
-
-       * threadpool.c (async_invoke_thread): Handle the wait function returning
-       WAIT_IO_COMPLETION as well.
-       (async_invoke_io_thread): Ditto.
-
-2009-01-09  Bill Holmes  <billholmes54@gmail.com>
-
-       * threads.c: Fixing the Windows build.
-
-       Code is contributed under MIT/X11 license.
-
-2009-01-09  Zoltan Varga  <vargaz@gmail.com>
+2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
 
-       * threads.c (signal_thread_state_change): Call wapi_interrupt_thread () to
-       interrupt a wait.
-       (mono_thread_execute_interruption): Call wapi_clear_interruption () to enable
-       the thread to wait again.
+       * metadata-verify.c: Add lfanew verification.
 
 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
 
index f1fef1321e1d5b4996ba21600f62efe741b0a076..25f0003c05ff5d48e1a2fe16a0335da084ebbf7a 100644 (file)
@@ -42,14 +42,19 @@ typedef struct {
 static void
 verify_msdos_header (VerifyContext *ctx)
 {
+       guint32 lfanew;
        if (ctx->size < 128) {
                ADD_ERROR (ctx, g_strdup ("Not enough space for the MS-DOS header"));
                return;
        }
        if (ctx->data [0] != 0x4d || ctx->data [1] != 0x5a)
                ADD_ERROR (ctx,  g_strdup ("Invalid MS-DOS watermark"));
+       lfanew = read32 (ctx->data + 0x3c);
+       if (lfanew > ctx->size - 4)
+               ADD_ERROR (ctx,  g_strdup ("MS-DOS lfanew offset points to outside of the file"));
 }
 
+
 GSList*
 mono_image_verify (const char *data, guint32 size)
 {