Permalink
Browse files

elf.c: in read_elf32, compare read size against ehdr32 instead of ehd…

…r. (#291)

Before this commit, read_elf32 accidently compared the read size
against the global 'ehdr' struct, which is an Elf64 header.
  • Loading branch information...
1 parent 76d6cd5 commit 7b6bd44db84a1901fa6904dca2f37254631ccb7a @probonopd committed on GitHub Nov 16, 2016
Showing with 1 addition and 1 deletion.
  1. +1 −1 elf.c
View
@@ -49,7 +49,7 @@ static unsigned long read_elf32(int fd)
ssize_t ret;
ret = pread(fd, &ehdr32, sizeof(ehdr32), 0);
- if (ret < 0 || (size_t)ret != sizeof(ehdr)) {
+ if (ret < 0 || (size_t)ret != sizeof(ehdr32)) {
fprintf(stderr, "Read of ELF header from %s failed: %s\n",
fname, strerror(errno));
exit(10);

0 comments on commit 7b6bd44

Please sign in to comment.