diff options
author | DJ Delorie <dj@redhat.com> | 2013-01-07 20:28:44 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2013-01-07 20:28:44 +0000 |
commit | 07a8e9f0361a21ecced933a32e98a38e7b04d590 (patch) | |
tree | a27a94876953e454a953198f91100749b0974353 /libiberty/simple-object-mach-o.c | |
parent | f2a6224b9cebb750e91014fe824390bc271cfa34 (diff) | |
download | gdb-07a8e9f0361a21ecced933a32e98a38e7b04d590.zip gdb-07a8e9f0361a21ecced933a32e98a38e7b04d590.tar.gz gdb-07a8e9f0361a21ecced933a32e98a38e7b04d590.tar.bz2 |
merge from gcc
Diffstat (limited to 'libiberty/simple-object-mach-o.c')
-rw-r--r-- | libiberty/simple-object-mach-o.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libiberty/simple-object-mach-o.c b/libiberty/simple-object-mach-o.c index af5e4f9..6fde672 100644 --- a/libiberty/simple-object-mach-o.c +++ b/libiberty/simple-object-mach-o.c @@ -1,5 +1,5 @@ /* simple-object-mach-o.c -- routines to manipulate Mach-O object files. - Copyright 2010, 2011 Free Software Foundation, Inc. + Copyright 2010, 2011, 2013 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. This program is free software; you can redistribute it and/or modify it @@ -701,12 +701,13 @@ simple_object_mach_o_segment (simple_object_read *sobj, off_t offset, /* Otherwise, make a name like __segment,__section as per the convention in mach-o asm. */ name = &namebuf[0]; - memset (namebuf, 0, MACH_O_NAME_LEN * 2 + 2); memcpy (namebuf, (char *) sechdr + segname_offset, MACH_O_NAME_LEN); + namebuf[MACH_O_NAME_LEN] = '\0'; l = strlen (namebuf); namebuf[l] = ','; memcpy (namebuf + l + 1, (char *) sechdr + sectname_offset, MACH_O_NAME_LEN); + namebuf[l + 1 + MACH_O_NAME_LEN] = '\0'; } simple_object_mach_o_section_info (omr->is_big_endian, is_32, sechdr, |