From: Mark Wielaard Date: Mon, 1 Oct 2012 14:10:46 +0000 (+0200) Subject: derelocate.c (find_section): Check next section exists before accessing it. X-Git-Tag: elfutils-0.156~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b25782ecd5a9d60373878f887cee65d55d98e76;p=thirdparty%2Felfutils.git derelocate.c (find_section): Check next section exists before accessing it. Signed-off-by: Mark Wielaard --- 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;