2011-12-12 Iain Sandoe <iains@gcc.gnu.org>
authorTristan Gingold <gingold@adacore.com>
Mon, 12 Dec 2011 13:45:47 +0000 (13:45 +0000)
committerTristan Gingold <gingold@adacore.com>
Mon, 12 Dec 2011 13:45:47 +0000 (13:45 +0000)
* mach-o.c (bfd_mach_o_read_section_32): Null-terminate sectname.
(bfd_mach_o_read_section_64): Likewise.

bfd/ChangeLog
bfd/mach-o.c

index 7c2cb07a692d69aa14fe9194f305371f49965b40..3f1dc2540fa3318782ab88dc0025c228174cfc07 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-12  Iain Sandoe  <iains@gcc.gnu.org>
+
+       * mach-o.c (bfd_mach_o_read_section_32): Null-terminate sectname.
+       (bfd_mach_o_read_section_64): Likewise.
+
 2011-12-11  John Davis Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        PR binutils/13476
index 82aeb8d8ce73f2696edf5f7f6da8b0641ff57c9f..a3866046ad0885949ad6fe2c70822eba740ae05f 100644 (file)
@@ -1698,7 +1698,7 @@ bfd_mach_o_read_section_32 (bfd *abfd,
   memcpy (section->segname, raw.segname, sizeof (raw.segname));
   section->segname[BFD_MACH_O_SEGNAME_SIZE] = 0;
   memcpy (section->sectname, raw.sectname, sizeof (raw.sectname));
-  section->segname[BFD_MACH_O_SECTNAME_SIZE] = 0;
+  section->sectname[BFD_MACH_O_SECTNAME_SIZE] = 0;
   section->addr = bfd_h_get_32 (abfd, raw.addr);
   section->size = bfd_h_get_32 (abfd, raw.size);
   section->offset = bfd_h_get_32 (abfd, raw.offset);
@@ -1737,7 +1737,7 @@ bfd_mach_o_read_section_64 (bfd *abfd,
   memcpy (section->segname, raw.segname, sizeof (raw.segname));
   section->segname[BFD_MACH_O_SEGNAME_SIZE] = 0;
   memcpy (section->sectname, raw.sectname, sizeof (raw.sectname));
-  section->segname[BFD_MACH_O_SECTNAME_SIZE] = 0;
+  section->sectname[BFD_MACH_O_SECTNAME_SIZE] = 0;
   section->addr = bfd_h_get_64 (abfd, raw.addr);
   section->size = bfd_h_get_64 (abfd, raw.size);
   section->offset = bfd_h_get_32 (abfd, raw.offset);