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>
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
possible. When converting make sure we don't exceed the number
of bytes available in either in.d_buf nor out.d_buf.
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);