]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix a bug in offset checking
authorPetr Machata <pmachata@redhat.com>
Mon, 8 Jun 2009 13:46:16 +0000 (15:46 +0200)
committerPetr Machata <pmachata@redhat.com>
Mon, 8 Jun 2009 13:46:16 +0000 (15:46 +0200)
libdw/libdwP.h

index 8f180ccf3693eceb25a69ca4519971fa0aefbeab..97a2e042f6837ca3fd04a54a16817d46819083ff 100644 (file)
@@ -483,7 +483,7 @@ __libdw_in_section (Dwarf *dbg, int sec_index,
   if (data == NULL)
     return false;
   if (unlikely (addr < data->d_buf)
-      || unlikely (addr >= data->d_buf + data->d_size - size))
+      || unlikely (data->d_size - (addr - data->d_buf) < size))
     {
       __libdw_seterrno (DWARF_E_INVALID_OFFSET);
       return false;