]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
derelocate.c (find_section): Check next section exists before accessing it.
authorMark Wielaard <mjw@redhat.com>
Mon, 1 Oct 2012 14:10:46 +0000 (16:10 +0200)
committerMark Wielaard <mjw@redhat.com>
Mon, 1 Oct 2012 15:32:56 +0000 (17:32 +0200)
Signed-off-by: Mark Wielaard <mjw@redhat.com>
libdwfl/ChangeLog
libdwfl/derelocate.c

index 36db7a327ea712e1aba08bbac47ef07ad30acb1f..7f2c7778834ea3bcbfc468cba37a52430d96188b 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-01  Mark Wielaard  <mjw@redhat.com>
+
+       * derelocate.c (find_section): Check next section exists before
+       accessing it.
+
 2012-08-01  Petr Machata  <pmachata@redhat.com>
 
        * offline.c (process_archive_member): Ignore entry "/SYM64/".
index e3fcba8d7ad5f60095674b3835dccf03cf4196b8..56f998c34f452fbba38fb404a7388867ca0ec46a 100644 (file)
@@ -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;