This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] nm: Stop processing ar members on first invalid offset.
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Fri, 26 Dec 2014 16:18:13 +0100
- Subject: [PATCH] nm: Stop processing ar members on first invalid offset.
Otherwise we will keep looping on that same invalid entry.
https://bugzilla.redhat.com/show_bug.cgi?id=1170810
Reported-by: Alexander Cherepanov <cherepan@mccme.ru>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
src/ChangeLog | 4 ++++
src/nm.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/ChangeLog b/src/ChangeLog
index 7203dd9..18a038d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-26 Mark Wielaard <mjw@redhat.com>
+
+ * nm.c (handle_ar): Break on arsym with invalid offset.
+
2014-12-20 Mark Wielaard <mjw@redhat.com>
* readelf.c (print_debug_macinfo_section): Mark cus sentinel files
diff --git a/src/nm.c b/src/nm.c
index 4f2e0e7..6a9f8e1 100644
--- a/src/nm.c
+++ b/src/nm.c
@@ -468,7 +468,7 @@ handle_ar (int fd, Elf *elf, const char *prefix, const char *fname,
{
error (0, 0, gettext ("invalid offset %zu for symbol %s"),
arsym->as_off, arsym->as_name);
- continue;
+ break;
}
printf (gettext ("%s in %s\n"), arsym->as_name, arhdr->ar_name);
--
2.1.0