call fseek at the beginning of readident

This commit is contained in:
David du Colombier 2017-07-27 23:14:25 +02:00
parent b409e482cf
commit d62e3c29b5
1 changed files with 2 additions and 0 deletions

2
elf.c
View File

@ -444,6 +444,8 @@ readident(FILE *f, Fhdr *fp)
unsigned int i;
uint8_t *p;
fseek(f, 0, SEEK_SET);
p = buf;
if (fread(p, EI_NIDENT, 1, f) != 1)
return -1;