diff options
author | emaste <emaste@FreeBSD.org> | 2015-12-11 20:13:36 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2015-12-11 20:13:36 +0000 |
commit | 08c7091d4a30fde09fdda23d2016d8d11624cb15 (patch) | |
tree | fa4048de2a3b89d666f609663721fe14dee0627a /libelf/elf_data.c | |
parent | f776db09f98d97717b9d579ba1d88ed8c5e3a040 (diff) | |
download | FreeBSD-src-08c7091d4a30fde09fdda23d2016d8d11624cb15.zip FreeBSD-src-08c7091d4a30fde09fdda23d2016d8d11624cb15.tar.gz |
Import ELF Tool Chain snapshot revision r3272
From http://svn.code.sf.net/p/elftoolchain/code/
Diffstat (limited to 'libelf/elf_data.c')
-rw-r--r-- | libelf/elf_data.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libelf/elf_data.c b/libelf/elf_data.c index ce80e1c..3d8ef6c 100644 --- a/libelf/elf_data.c +++ b/libelf/elf_data.c @@ -32,7 +32,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: elf_data.c 3177 2015-03-30 18:19:41Z emaste $"); +ELFTC_VCSID("$Id: elf_data.c 3258 2015-11-20 18:59:43Z emaste $"); Elf_Data * elf_getdata(Elf_Scn *s, Elf_Data *ed) @@ -253,6 +253,12 @@ elf_rawdata(Elf_Scn *s, Elf_Data *ed) return (NULL); } + if (sh_type != SHT_NOBITS && + sh_offset + sh_size > (uint64_t) e->e_rawsize) { + LIBELF_SET_ERROR(SECTION, 0); + return (NULL); + } + if ((d = _libelf_allocate_data(s)) == NULL) return (NULL); |