summaryrefslogtreecommitdiff
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
commit0861bdabe1b9495a50886ba69841b0631d2d9dc7 (patch)
treeb61886cc095718007c34f078518e71d67e66768a /binutils/readelf.c
parent6bc9d4de3851a9c7ee8fedd6e9e21932f9047c39 (diff)
downloadbinutils-redhat-0861bdabe1b9495a50886ba69841b0631d2d9dc7.tar.gz
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 266e37e792..a7831ef510 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,