dwfl_segment_report_module can be called with the same module
name, start and end address twice (probably because of a corrupt
core file). In that case don't override the main.elf handle if
it already exists.
https://sourceware.org/bugzilla/show_bug.cgi?id=28655
Signed-off-by: Mark Wielaard <mark@klomp.org>
2021-12-08 Mark Wielaard <mark@klomp.org>
+ * dwfl_segment_report_module.c (dwfl_segment_report_module): Check
+ Dwfl_Module isn't associated with an Elf before installing it.
+
+2021-12-08 Mark Wielaard <mark@klomp.org>
+
* dwfl_segment_report_module.c (dwfl_segment_report_module): Don't
trust e_shentsize.
elf->flags |= ELF_F_MALLOCED;
}
- if (elf != NULL)
+ if (elf != NULL && mod->main.elf == NULL)
{
/* Install the file in the module. */
mod->main.elf = elf;