summaryrefslogtreecommitdiffstats
path: root/src/file_elf.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-10-05 21:13:57 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-10-05 21:13:57 +0200
commit3246c0e8d4ca6a1c21a3f9fcc403b6f84b5c6b59 (patch)
tree2887ab0e7ed6c611ba76ee9fb7b561b94a66af1b /src/file_elf.c
parentf83141b780f3d6ea62501f7ab1d38ce00d2b9cf2 (diff)
PhotoRec: fix ELF size detection
Diffstat (limited to 'src/file_elf.c')
-rw-r--r--src/file_elf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/file_elf.c b/src/file_elf.c
index 9630513..c765054 100644
--- a/src/file_elf.c
+++ b/src/file_elf.c
@@ -138,8 +138,8 @@ static int header_check_elf(const unsigned char *buffer, const unsigned int buff
else
{
const Elf64_Ehdr *hdr64=(const Elf64_Ehdr *)buffer;
- const uint64_t tmp=(hdr64->e_ident[EI_DATA]==ELFDATA2LSB ? le64(hdr32->e_shoff) : be64(hdr32->e_shoff));
- file_recovery_new->min_filesize=(hdr64->e_ident[EI_DATA]==ELFDATA2LSB ? le64(hdr32->e_phoff) : be64(hdr32->e_phoff));
+ const uint64_t tmp=(hdr64->e_ident[EI_DATA]==ELFDATA2LSB ? le64(hdr64->e_shoff) : be64(hdr64->e_shoff));
+ file_recovery_new->min_filesize=(hdr64->e_ident[EI_DATA]==ELFDATA2LSB ? le64(hdr64->e_phoff) : be64(hdr64->e_phoff));
if(file_recovery_new->min_filesize < tmp)
file_recovery_new->min_filesize=tmp;
}