summaryrefslogtreecommitdiff
path: root/bfd/mach-o.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2011-12-12 13:45:46 +0000
committerTristan Gingold <gingold@adacore.com>2011-12-12 13:45:46 +0000
commit303142870d1b31c7b9a6d11f2c4f2228f180d603 (patch)
treed3520a320a552db13edaded9efe322ac75378431 /bfd/mach-o.c
parentc63abeb08bf52cb60af3cc1a44c9789c3ad01f6b (diff)
downloadgdb-303142870d1b31c7b9a6d11f2c4f2228f180d603.tar.gz
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.
Diffstat (limited to 'bfd/mach-o.c')
-rw-r--r--bfd/mach-o.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
index 82aeb8d8ce7..a3866046ad0 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);