diff options
-rw-r--r-- | libdwfl/ChangeLog | 5 | ||||
-rw-r--r-- | libdwfl/dwfl_segment_report_module.c | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 95dc426b..1da888f6 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,8 @@ +2019-03-27 Mark Wielaard <mark@klomp.org> + + * dwfl_segment_report_module.c (dwfl_segment_report_module): Check + ph_buffer_size vs xlatefrom.d_size after read_portion call. + 2019-02-24 Mark Wielaard <mark@klomp.org> * linux-kernel-modules.c (intuit_kernel_bounds): Init *notes before diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c index f6ad39b3..76ba1506 100644 --- a/libdwfl/dwfl_segment_report_module.c +++ b/libdwfl/dwfl_segment_report_module.c @@ -412,6 +412,12 @@ dwfl_segment_report_module (Dwfl *dwfl, int ndx, const char *name, start + phoff, xlatefrom.d_size)) return finish (); + /* ph_buffer_size will be zero if we got everything from the initial + buffer, otherwise it will be the size of the new buffer that + could be read. */ + if (ph_buffer_size != 0) + xlatefrom.d_size = ph_buffer_size; + xlatefrom.d_buf = ph_buffer; bool class32 = ei_class == ELFCLASS32; |