* [PATCH] libdwfl: Make sure we know the phdr entry size before searching phdrs.
@ 2021-12-08 19:52 Mark Wielaard
0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2021-12-08 19:52 UTC (permalink / raw)
To: elfutils-devel; +Cc: Mark Wielaard
Without the program header entry size we cannot search through the
phdrs.
https://sourceware.org/bugzilla/show_bug.cgi?id=28657
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
libdwfl/ChangeLog | 4 ++++
libdwfl/link_map.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 852b199a..8dd595f8 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,7 @@
+2021-12-08 Mark Wielaard <mark@klomp.org>
+
+ * link_map.c (dwfl_link_map_report): Make sure phent != 0.
+
2021-12-08 Mark Wielaard <mark@klomp.org>
* link_map.c (dwfl_link_map_report): Limit malloc size to max
diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c
index 1c298a8e..623b3062 100644
--- a/libdwfl/link_map.c
+++ b/libdwfl/link_map.c
@@ -784,7 +784,7 @@ dwfl_link_map_report (Dwfl *dwfl, const void *auxv, size_t auxv_size,
GElf_Xword dyn_filesz = 0;
GElf_Addr dyn_bias = (GElf_Addr) -1;
- if (phdr != 0 && phnum != 0)
+ if (phdr != 0 && phnum != 0 && phent != 0)
{
Dwfl_Module *phdr_mod;
int phdr_segndx = INTUSE(dwfl_addrsegment) (dwfl, phdr, &phdr_mod);
--
2.30.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-08 19:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08 19:52 [PATCH] libdwfl: Make sure we know the phdr entry size before searching phdrs Mark Wielaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).