* mach-o.c (bfd_mach_o_archive_p): Restrict the number of
authorAndreas Schwab <schwab@linux-m68k.org>
Tue, 27 Jan 2009 16:37:10 +0000 (16:37 +0000)
committerAndreas Schwab <schwab@linux-m68k.org>
Tue, 27 Jan 2009 16:37:10 +0000 (16:37 +0000)
architectures in the archive.

bfd/ChangeLog
bfd/mach-o.c

index 41cee38341b48a5d7c77e35d323fc95589ffef0b..f6102d57e2de71f00f41dd7b12031beca36be769 100644 (file)
@@ -1,3 +1,8 @@
+2009-01-27  Andreas Schwab  <schwab@suse.de>
+
+       * mach-o.c (bfd_mach_o_archive_p): Restrict the number of
+       architectures in the archive.
+
 2009-01-27  Hans-Peter Nilsson  <hp@axis.com>
 
        * elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_16_DTPREL>
index 9ae1bba1f7563894ad9fcc52df3182c676001708..e0a6fa4772fcdda89612a69e0a5811af2e131f80 100644 (file)
@@ -2098,6 +2098,11 @@ bfd_mach_o_archive_p (bfd *abfd)
   adata->nfat_arch = bfd_getb32 (buf + 4);
   if (adata->magic != 0xcafebabe)
     goto error;
+  /* Avoid matching Java bytecode files, which have the same magic number.
+     In the Java bytecode file format this field contains the JVM version,
+     which starts at 43.0.  */
+  if (adata->nfat_arch > 30)
+    goto error;
 
   adata->archentries = 
     bfd_alloc (abfd, adata->nfat_arch * sizeof (mach_o_fat_archentry));
This page took 0.028402 seconds and 4 git commands to generate.