Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: libiberty/simple-object-mach-o.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « libiberty/simple-object-common.h ('k') | libiberty/simple-object-xcoff.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libiberty/simple-object-mach-o.c
diff --git a/libiberty/simple-object-mach-o.c b/libiberty/simple-object-mach-o.c
index af5e4f9ca8841d825b56d6bc044d268f30ab9cfd..d1b676d777c1604bbfef86d84a3ec6c51d4d907a 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
@@ -432,7 +432,7 @@ simple_object_mach_o_segment (simple_object_read *sobj, off_t offset,
size_t index_size;
unsigned int n_wrapped_sects;
size_t wrapper_sect_size;
- off_t wrapper_sect_offset;
+ off_t wrapper_sect_offset = 0;
fetch_32 = (omr->is_big_endian
? simple_object_fetch_big_32
@@ -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,
« no previous file with comments | « libiberty/simple-object-common.h ('k') | libiberty/simple-object-xcoff.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698