diff options
author | Jose E. Marchesi <jose.marchesi@oracle.com> | 2015-10-20 16:22:08 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2015-10-22 23:09:56 +0200 |
commit | 1ed7195ea8f6ccb47c2e5b911fbc4105f18a5d2e (patch) | |
tree | ae016b2b8da1a3314c8ae7ac7a3fdd25bfc2e57c /libelf | |
parent | 34bb96a2c181846291ea863928003faaec3a9f55 (diff) | |
download | elfutils-1ed7195ea8f6ccb47c2e5b911fbc4105f18a5d2e.tar.gz |
libelf: use the right size when preading in[0].sh_size
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com>
Diffstat (limited to 'libelf')
-rw-r--r-- | libelf/ChangeLog | 5 | ||||
-rw-r--r-- | libelf/elf_begin.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/libelf/ChangeLog b/libelf/ChangeLog index 8beecd4b..ef74b5bf 100644 --- a/libelf/ChangeLog +++ b/libelf/ChangeLog @@ -1,3 +1,8 @@ +2015-10-20 Jose E. Marchesi <jose.marchesi@oracle.com> + + * elf_begin.c (get_shnum): Elf64_Shdr.sh_size is an Elf64_Xword. + Fix the size argument to pread_retry. + 2015-10-13 Chih-Hung Hsieh <chh@google.com> * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Move nested diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c index f26119c2..d2920c4e 100644 --- a/libelf/elf_begin.c +++ b/libelf/elf_begin.c @@ -216,7 +216,7 @@ get_shnum (void *map_address, unsigned char *e_ident, int fildes, off_t offset, + offset))->sh_size, sizeof (Elf64_Xword)); else - if (unlikely (pread_retry (fildes, &size, sizeof (Elf64_Word), + if (unlikely (pread_retry (fildes, &size, sizeof (Elf64_Xword), offset + ehdr.e64->e_shoff + offsetof (Elf64_Shdr, sh_size)) != sizeof (Elf64_Xword))) |