diff options
-rw-r--r-- | libdwfl/ChangeLog | 4 | ||||
-rw-r--r-- | libdwfl/link_map.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 96251f0d..d875eabd 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog | |||
@@ -1,5 +1,9 @@ | |||
1 | 2021-12-08 Mark Wielaard <mark@klomp.org> | 1 | 2021-12-08 Mark Wielaard <mark@klomp.org> |
2 | 2 | ||
3 | * link_map.c (dwfl_link_map_report): Make sure phent != 0. | ||
4 | |||
5 | 2021-12-08 Mark Wielaard <mark@klomp.org> | ||
6 | |||
3 | * link_map.c (dwfl_link_map_report): Limit malloc size to max | 7 | * link_map.c (dwfl_link_map_report): Limit malloc size to max |
4 | possible. When converting make sure we don't exceed the number | 8 | possible. When converting make sure we don't exceed the number |
5 | of bytes available in either in.d_buf nor out.d_buf. | 9 | of bytes available in either in.d_buf nor out.d_buf. |
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, | |||
784 | GElf_Xword dyn_filesz = 0; | 784 | GElf_Xword dyn_filesz = 0; |
785 | GElf_Addr dyn_bias = (GElf_Addr) -1; | 785 | GElf_Addr dyn_bias = (GElf_Addr) -1; |
786 | 786 | ||
787 | if (phdr != 0 && phnum != 0) | 787 | if (phdr != 0 && phnum != 0 && phent != 0) |
788 | { | 788 | { |
789 | Dwfl_Module *phdr_mod; | 789 | Dwfl_Module *phdr_mod; |
790 | int phdr_segndx = INTUSE(dwfl_addrsegment) (dwfl, phdr, &phdr_mod); | 790 | int phdr_segndx = INTUSE(dwfl_addrsegment) (dwfl, phdr, &phdr_mod); |