Catch potential integer overflow in readelf when processing corrupt binaries.
[deliverable/binutils-gdb.git] / binutils / readelf.c
index b896ad9f40689ffa840d50d636cba8a942ed1baa..e785fde43e7c0de796dd77e1e689826370a3e4c6 100644 (file)
@@ -13366,7 +13366,7 @@ apply_relocations (Filedata *                 filedata,
            }
 
          rloc = start + rp->r_offset;
-         if ((rloc + reloc_size) > end || (rloc < start))
+         if (rloc >= end || (rloc + reloc_size) > end || (rloc < start))
            {
              warn (_("skipping invalid relocation offset 0x%lx in section %s\n"),
                    (unsigned long) rp->r_offset,
This page took 0.024246 seconds and 4 git commands to generate.