diff options
Diffstat (limited to 'libelf')
-rw-r--r-- | libelf/_libelf_config.h | 8 | ||||
-rw-r--r-- | libelf/elf_data.c | 6 | ||||
-rw-r--r-- | libelf/libelf_ar.c | 4 | ||||
-rw-r--r-- | libelf/libelf_convert.m4 | 3 |
4 files changed, 11 insertions, 10 deletions
diff --git a/libelf/_libelf_config.h b/libelf/_libelf_config.h index 92e0b0ae781de..fccb2640ab9ed 100644 --- a/libelf/_libelf_config.h +++ b/libelf/_libelf_config.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _libelf_config.h 3396 2016-02-10 21:50:05Z emaste $ + * $Id: _libelf_config.h 3400 2016-02-12 18:38:49Z emaste $ */ #if defined(__APPLE__) || defined(__DragonFly__) @@ -99,9 +99,9 @@ #elif defined(__riscv64) -#define LIBELF_ARCH EM_RISCV -#define LIBELF_BYTEORDER ELFDATA2LSB -#define LIBELF_CLASS ELFCLASS64 +#define LIBELF_ARCH EM_RISCV +#define LIBELF_BYTEORDER ELFDATA2LSB +#define LIBELF_CLASS ELFCLASS64 #elif defined(__sparc__) diff --git a/libelf/elf_data.c b/libelf/elf_data.c index 3d8ef6cadaced..d494eda2de3f3 100644 --- a/libelf/elf_data.c +++ b/libelf/elf_data.c @@ -32,7 +32,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: elf_data.c 3258 2015-11-20 18:59:43Z emaste $"); +ELFTC_VCSID("$Id: elf_data.c 3466 2016-05-11 18:35:44Z emaste $"); Elf_Data * elf_getdata(Elf_Scn *s, Elf_Data *ed) @@ -94,7 +94,7 @@ elf_getdata(Elf_Scn *s, Elf_Data *ed) if ((elftype = _libelf_xlate_shtype(sh_type)) < ELF_T_FIRST || elftype > ELF_T_LAST || (sh_type != SHT_NOBITS && - sh_offset + sh_size > (uint64_t) e->e_rawsize)) { + (sh_offset > e->e_rawsize || sh_size > e->e_rawsize - sh_offset))) { LIBELF_SET_ERROR(SECTION, 0); return (NULL); } @@ -254,7 +254,7 @@ elf_rawdata(Elf_Scn *s, Elf_Data *ed) } if (sh_type != SHT_NOBITS && - sh_offset + sh_size > (uint64_t) e->e_rawsize) { + (sh_offset > e->e_rawsize || sh_size > e->e_rawsize - sh_offset)) { LIBELF_SET_ERROR(SECTION, 0); return (NULL); } diff --git a/libelf/libelf_ar.c b/libelf/libelf_ar.c index faeec2c60765f..8fce7419726e3 100644 --- a/libelf/libelf_ar.c +++ b/libelf/libelf_ar.c @@ -33,7 +33,7 @@ #include "_libelf.h" #include "_libelf_ar.h" -ELFTC_VCSID("$Id: libelf_ar.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: libelf_ar.c 3446 2016-05-03 01:31:17Z emaste $"); #define LIBELF_NALLOC_SIZE 16 @@ -64,7 +64,7 @@ ELFTC_VCSID("$Id: libelf_ar.c 3174 2015-03-27 17:13:41Z emaste $"); * table where the actual file name of the object starts. Strings in * the string table are padded to start on even addresses. * - * In the BSD format, file names can be upto 16 characters. File + * In the BSD format, file names can be up to 16 characters. File * names shorter than 16 characters are padded to 16 characters using * (ASCII) space characters. File names with embedded spaces and file * names longer than 16 characters are stored immediately after the diff --git a/libelf/libelf_convert.m4 b/libelf/libelf_convert.m4 index 9f99f1ead8667..ec395902a182c 100644 --- a/libelf/libelf_convert.m4 +++ b/libelf/libelf_convert.m4 @@ -30,7 +30,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: libelf_convert.m4 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: libelf_convert.m4 3429 2016-03-12 04:12:39Z emaste $"); /* WARNING: GENERATED FROM __file__. */ @@ -1019,6 +1019,7 @@ _libelf_cvt_NOTE_tof(unsigned char *dst, size_t dsz, unsigned char *src, WRITE_WORD(dst, type); src += sizeof(Elf_Note); + count -= sizeof(Elf_Note); if (count < sz) sz = count; |