From 7788335e62837272e7629ee517392406fd252ac7 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sun, 19 Nov 2000 20:57:42 +0000 Subject: [PATCH] * readelf.c (display_debug_lines): Adjust last change to use sizeof (external->li_length). --- binutils/ChangeLog | 5 +++++ binutils/readelf.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index bda8ab8997..a2ab7d2ef7 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,10 @@ 2000-11-17 Richard Henderson + * readelf.c (display_debug_lines): Adjust last change to + use sizeof (external->li_length). + +2000-11-17 Richard Henderson + * readelf.c (display_debug_lines): Fix section length check and end_of_sequence computation. diff --git a/binutils/readelf.c b/binutils/readelf.c index f8238157bc..f1873cd512 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 + 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); -- 2.11.0