Commit 23bf2e76 authored by Stefan Weil's avatar Stefan Weil Committed by Michael Tokarev
Browse files

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



This fixes a warning from Coverity.

Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
Reviewed-by: default avatarThomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
parent 6cbfb86f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;