From: Mark Wielaard Date: Sun, 7 Dec 2014 22:40:12 +0000 (+0100) Subject: readelf: maximum operations per instruction cannot be zero in .debug_line. X-Git-Tag: elfutils-0.161~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0c5ef85bbea093af42c2b95a1f349ebef63de0d;p=thirdparty%2Felfutils.git readelf: maximum operations per instruction cannot be zero in .debug_line. Signed-off-by: Mark Wielaard --- diff --git a/src/ChangeLog b/src/ChangeLog index ccbd6e80f..1c3cf2fc6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-12-07 Mark Wielaard + + * readelf.c (print_debug_line_section): max_ops_per_instr cannot + be zero. + 2014-12-07 Mark Wielaard * readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref diff --git a/src/readelf.c b/src/readelf.c index 881bb45d9..fa9ede1d3 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -6506,6 +6506,14 @@ print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr, op_index = (op_index + op_advance) % max_ops_per_instr; } + if (max_ops_per_instr == 0) + { + error (0, 0, + gettext ("invalid maximum operations per instruction is zero")); + linep = lineendp; + continue; + } + while (linep < lineendp) { size_t offset = linep - (const unsigned char *) data->d_buf;