https://sourceware.org/bugzilla/show_bug.cgi?id=24116
Mark Wielaard <mark at klomp dot org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |mark at klomp dot org Resolution|--- |FIXED --- Comment #3 from Mark Wielaard <mark at klomp dot org> --- Yeah, we should check the unknown parameters are actually there. Luckily other checks make sure we don't read more than one byte past the end of the data. commit a17c2c0917901ffa542ac4d3e327d46742219e04 Author: Mark Wielaard <m...@klomp.org> Date: Tue Jan 22 15:55:18 2019 +0100 readelf: Don't go past end of line data reading unknown opcode parameters. https://sourceware.org/bugzilla/show_bug.cgi?id=24116 Signed-off-by: Mark Wielaard <m...@klomp.org> diff --git a/src/readelf.c b/src/readelf.c index 6bad3bf..e3e699c 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -8845,7 +8845,8 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr, " unknown opcode with %" PRIu8 " parameters:", standard_opcode_lengths[opcode]), standard_opcode_lengths[opcode]); - for (int n = standard_opcode_lengths[opcode]; n > 0; --n) + for (int n = standard_opcode_lengths[opcode]; + n > 0 && linep < lineendp; --n) { get_uleb128 (u128, linep, lineendp); if (n != standard_opcode_lengths[opcode]) -- You are receiving this mail because: You are on the CC list for the bug.