diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-11-01 15:45:29 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-11-01 15:45:29 +0000 |
commit | bd51004ae29af49d35ab573df8614b93299477ac (patch) | |
tree | 33176a8d6af082acc5ecb40c917e7cd63e993f88 /usr.bin/ctfdump | |
parent | 1b5afcbfc5cb528446cd13eb07907944bbe62fe9 (diff) |
Disable relocation until it is shown to be necessary. This code
is present here because ctfconv(1) needs it.
Prevent an access violation since the file is mmap(2)'d without
write permission.
Triggered by jsg@ with afl(1).
Diffstat (limited to 'usr.bin/ctfdump')
-rw-r--r-- | usr.bin/ctfdump/elf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/ctfdump/elf.c b/usr.bin/ctfdump/elf.c index cee7024bb39..fbf653ac69e 100644 --- a/usr.bin/ctfdump/elf.c +++ b/usr.bin/ctfdump/elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elf.c,v 1.5 2017/10/27 08:33:46 mpi Exp $ */ +/* $OpenBSD: elf.c,v 1.6 2017/11/01 15:45:28 mpi Exp $ */ /* * Copyright (c) 2016 Martin Pieuchot <mpi@openbsd.org> @@ -172,8 +172,10 @@ elf_getsection(char *p, size_t filesize, const char *sname, const char *shstab, sidx = i; sdata = p + sh->sh_offset; ssz = sh->sh_size; +#ifdef needreloc elf_reloc_apply(p, filesize, shstab, shstabsz, sidx, sdata, ssz); +#endif break; } } |