aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2011-12-12 13:45:47 +0000
committerTristan Gingold <gingold@adacore.com>2011-12-12 13:45:47 +0000
commit69499dca199e87f57386b49548ade04a7f337430 (patch)
tree6fa2256a06a354cafaea9e0d5bf2584430763faf
parentff7d1690b4638a5c7302cd6cfdb84eb3aa23cbbd (diff)
downloadbinutils-69499dca199e87f57386b49548ade04a7f337430.zip
binutils-69499dca199e87f57386b49548ade04a7f337430.tar.gz
binutils-69499dca199e87f57386b49548ade04a7f337430.tar.bz2
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.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/mach-o.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7c2cb07..3f1dc25 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
index 82aeb8d..a386604 100644
--- a/bfd/mach-o.c
+++ b/bfd/mach-o.c
@@ -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);