readelf: memrchr searches backwards but takes the start buf as argument
authorMark Wielaard <mark@klomp.org>
Mon, 1 Aug 2022 00:02:16 +0000 (02:02 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 1 Aug 2022 09:09:50 +0000 (11:09 +0200)
commitd0ff4e224738adf34eba38dc33ffda67e5da6634
treee8acd2204c2520b961774e2611dfd4ddc92d4093
parent369c021c6eedae3665c1dbbaa4fc43afbbb698f4
readelf: memrchr searches backwards but takes the start buf as argument

The bug (caught by valgrind) was giving memrchr to end of the buffer.

Also as cleanup, Use d_val not d_ptr for calculating offset.
src/ChangeLog
src/readelf.c