From 5b25782ecd5a9d60373878f887cee65d55d98e76 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 1 Oct 2012 16:10:46 +0200 Subject: [PATCH] derelocate.c (find_section): Check next section exists before accessing it. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 5 +++++ libdwfl/derelocate.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 36db7a327..7f2c77788 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,8 @@ +2012-10-01 Mark Wielaard + + * derelocate.c (find_section): Check next section exists before + accessing it. + 2012-08-01 Petr Machata * offline.c (process_archive_member): Ignore entry "/SYM64/". diff --git a/libdwfl/derelocate.c b/libdwfl/derelocate.c index e3fcba8d7..56f998c34 100644 --- a/libdwfl/derelocate.c +++ b/libdwfl/derelocate.c @@ -317,7 +317,7 @@ find_section (Dwfl_Module *mod, Dwarf_Addr *addr) inside the next one. A section limit address can appear in line records. */ if (*addr == sections->refs[idx].end - && idx < sections->count + && idx + 1 < sections->count && *addr == sections->refs[idx + 1].start) ++idx; -- 2.47.2