]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
readelf: maximum operations per instruction cannot be zero in .debug_line.
authorMark Wielaard <mjw@redhat.com>
Sun, 7 Dec 2014 22:40:12 +0000 (23:40 +0100)
committerMark Wielaard <mjw@redhat.com>
Thu, 11 Dec 2014 14:17:31 +0000 (15:17 +0100)
Signed-off-by: Mark Wielaard <mjw@redhat.com>
src/ChangeLog
src/readelf.c

index ccbd6e80f120e71df3778dc1975884ee5cc74d5f..1c3cf2fc64c46369ff2818d62c0eadb7b781d2a7 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-07  Mark Wielaard  <mjw@redhat.com>
+
+       * readelf.c (print_debug_line_section): max_ops_per_instr cannot
+       be zero.
+
 2014-12-07  Mark Wielaard  <mjw@redhat.com>
 
        * readelf.c (print_ops): Handle zero ref_size for DW_OP_call_ref
index 881bb45d98ebd7cedf185c6cbf6868376b7edce2..fa9ede1d3fd43079107218207ef1d8660250f04d 100644 (file)
@@ -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;