* readelf.c (display_debug_lines): Adjust last change to
authorRichard Henderson <rth@redhat.com>
Sun, 19 Nov 2000 20:57:42 +0000 (20:57 +0000)
committerRichard Henderson <rth@redhat.com>
Sun, 19 Nov 2000 20:57:42 +0000 (20:57 +0000)
        use sizeof (external->li_length).

binutils/ChangeLog
binutils/readelf.c

index bda8ab89972c4e9339c0b58f5644010e4be074ae..a2ab7d2ef7c0019a08caa7a482496f834a869644 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-17  Richard Henderson  <rth@redhat.com>
+
+       * readelf.c (display_debug_lines): Adjust last change to
+       use sizeof (external->li_length).
+
 2000-11-17  Richard Henderson  <rth@redhat.com>
 
        * readelf.c (display_debug_lines): Fix section length check
index f8238157bc2d0a816aee7cbc2f82c3e132c33b96..f1873cd5126f86bd3f4aa72605453823df8f587a 100644 (file)
@@ -5005,7 +5005,7 @@ display_debug_lines (section, start, file)
 
       /* Check the length of the block.  */
       info.li_length = BYTE_GET (external->li_length);
-      if (info.li_length + 4 > section->sh_size)
+      if (info.li_length + sizeof (external->li_length) > section->sh_size)
        {
          warn
            (_("The line info appears to be corrupt - the section is too small\n"));
@@ -5040,7 +5040,7 @@ display_debug_lines (section, start, file)
       printf (_("  Line Range:                  %d\n"), info.li_line_range);
       printf (_("  Opcode Base:                 %d\n"), info.li_opcode_base);
 
-      end_of_sequence = data + info.li_length + 4;
+      end_of_sequence = data + info.li_length + sizeof (external->li_length);
 
       reset_state_machine (info.li_default_is_stmt);