aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2000-11-17 08:28:59 +0000
committerRichard Henderson <rth@redhat.com>2000-11-17 08:28:59 +0000
commit512d22f487a268fc32a4a9a6a88e8ac538ad8448 (patch)
tree0a2f37c4d7ee0663a35a627bfa4f8c0aa486a308 /binutils
parentb90a5f516abe227b7efe478de3f92193fe2d8c2c (diff)
downloadgdb-512d22f487a268fc32a4a9a6a88e8ac538ad8448.zip
gdb-512d22f487a268fc32a4a9a6a88e8ac538ad8448.tar.gz
gdb-512d22f487a268fc32a4a9a6a88e8ac538ad8448.tar.bz2
* readelf.c (display_debug_lines): Fix section length check
and end_of_sequence computation.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/readelf.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 7587886..bda8ab8 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-17 Richard Henderson <rth@redhat.com>
+
+ * readelf.c (display_debug_lines): Fix section length check
+ and end_of_sequence computation.
+
2000-11-06 Nick Clifton <nickc@redhat.com>
* binutils.texi: Add GNU Free Documentation License.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index f9c4273..f823815 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -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 > section->sh_size)
+ if (info.li_length + 4 > 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 + sizeof (info.li_length);
+ end_of_sequence = data + info.li_length + 4;
reset_state_machine (info.li_default_is_stmt);