aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-03-22 16:04:55 +0000
committerNick Clifton <nickc@redhat.com>2013-03-22 16:04:55 +0000
commitc8da682327286c0612ddfe3836691b08547bb015 (patch)
tree73a9660fa985134f4077e6bedbd93b2152242288 /binutils/readelf.c
parent209be8d2a998544ff90bee54f76ca6cf5a812b55 (diff)
downloadfsf-binutils-gdb-c8da682327286c0612ddfe3836691b08547bb015.zip
fsf-binutils-gdb-c8da682327286c0612ddfe3836691b08547bb015.tar.gz
fsf-binutils-gdb-c8da682327286c0612ddfe3836691b08547bb015.tar.bz2
PR binutils/15157
* readelf.c (apply_relocations): Catch relocations with negative offsets.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 266e37e..a7831ef 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -10517,7 +10517,7 @@ apply_relocations (void * file,
}
rloc = start + rp->r_offset;
- if ((rloc + reloc_size) > end)
+ if ((rloc + reloc_size) > end || (rloc < start))
{
warn (_("skipping invalid relocation offset 0x%lx in section %s\n"),
(unsigned long) rp->r_offset,