]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libelf: use the right size when preading in[0].sh_size
authorJose E. Marchesi <jose.marchesi@oracle.com>
Tue, 20 Oct 2015 14:22:08 +0000 (16:22 +0200)
committerMark Wielaard <mjw@redhat.com>
Thu, 22 Oct 2015 21:09:56 +0000 (23:09 +0200)
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com>
libelf/ChangeLog
libelf/elf_begin.c

index 8beecd4b5d6659230a82a373391090dcebcb9ad0..ef74b5bf52ed7087e466806311bd417a6d661866 100644 (file)
@@ -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
index f26119c2fde5cb14339bf605eced4569bf18c075..d2920c4eed2c828806393f759e63a6bde11fa9a3 100644 (file)
@@ -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)))