diff options
author | Alan Modra <amodra@bigpond.net.au> | 2012-01-16 22:30:19 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2012-01-16 22:30:19 +0000 |
commit | 65be0ccfacf7fdc18142401b129fe691dbe0dd7f (patch) | |
tree | 9df0c97cdd20c51455d5a506d7e84a222859eb16 | |
parent | b07c527f5b38d57f43c159e793b67dceae34f6d6 (diff) | |
download | gdb-65be0ccfacf7fdc18142401b129fe691dbe0dd7f.tar.gz |
* elf32-ppc.c (ppc_elf_write_core_note <NT_PRPSINFO>): Don't leave
trailing garbage in the note.
* elf64-ppc.c (ppc64_elf_write_core_note <NT_PRPSINFO>): Likewise.
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf32-ppc.c | 4 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 15e217167fd..a0be3dc1d74 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2012-01-17 Alan Modra <amodra@gmail.com> + + * elf32-ppc.c (ppc_elf_write_core_note <NT_PRPSINFO>): Don't leave + trailing garbage in the note. + * elf64-ppc.c (ppc64_elf_write_core_note <NT_PRPSINFO>): Likewise. + 2012-01-16 Daniel Green <venix1@gmail.com> PR ld/13491 diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 18922dc02a5..bbf54a4d672 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -1,6 +1,6 @@ /* PowerPC-specific support for 32-bit ELF Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. @@ -1920,7 +1920,7 @@ ppc_elf_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type, ...) va_list ap; va_start (ap, note_type); - memset (data, 0, 32); + memset (data, 0, sizeof (data)); strncpy (data + 32, va_arg (ap, const char *), 16); strncpy (data + 48, va_arg (ap, const char *), 80); va_end (ap); diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 9c212b9c3f1..7ffbe0e42ce 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -2721,7 +2721,7 @@ ppc64_elf_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type, va_list ap; va_start (ap, note_type); - memset (data, 0, 40); + memset (data, 0, sizeof (data)); strncpy (data + 40, va_arg (ap, const char *), 16); strncpy (data + 56, va_arg (ap, const char *), 80); va_end (ap); |