This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Fix PR binutils/19147 -- off by one when printing NT_FILE note.
- From: Paul Pluzhnikov <ppluzhnikov at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 18 Oct 2015 16:40:31 -0000
- Subject: [binutils-gdb] Fix PR binutils/19147 -- off by one when printing NT_FILE note.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=595712bb07e5db19dde5879bdf1b827abbe90c60
commit 595712bb07e5db19dde5879bdf1b827abbe90c60
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date: Sun Oct 18 09:39:25 2015 -0700
Fix PR binutils/19147 -- off by one when printing NT_FILE note.
Diff:
---
binutils/ChangeLog | 5 +++++
binutils/readelf.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 9433f3d..512471c 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-18 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ PR binutils/19147
+ * readelf.c (print_core_note): Fix off-by-one bug.
+
2015-10-15 Alan Modra <amodra@gmail.com>
* objcopy.c (copy_object): Don't omit bfd_copy_private_bfd_data
diff --git a/binutils/readelf.c b/binutils/readelf.c
index e8c215d..22cec2c 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -15151,7 +15151,7 @@ print_core_note (Elf_Internal_Note *pnote)
(int) (4 + 2 * addr_size), _("End"),
(int) (4 + 2 * addr_size), _("Page Offset"));
filenames = descdata + count * 3 * addr_size;
- while (--count > 0)
+ while (count-- > 0)
{
bfd_vma start, end, file_ofs;