elf-loader: Add missing error handling for call of lseek

This fixes a warning from Coverity.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
Stefan Weil 2015-03-14 16:42:01 +01:00 committed by Michael Tokarev
parent 6cbfb86f4c
commit 23bf2e7680
1 changed files with 3 additions and 1 deletions

View File

@ -315,7 +315,9 @@ static int glue(load_elf, SZ)(const char *name, int fd,
glue(load_symbols, SZ)(&ehdr, fd, must_swab, clear_lsb);
size = ehdr.e_phnum * sizeof(phdr[0]);
lseek(fd, ehdr.e_phoff, SEEK_SET);
if (lseek(fd, ehdr.e_phoff, SEEK_SET) != ehdr.e_phoff) {
goto fail;
}
phdr = g_malloc0(size);
if (!phdr)
goto fail;