Commit 6cbfb86f authored by Stefan Weil's avatar Stefan Weil Committed by Michael Tokarev
Browse files

elf-loader: Fix truncation warning from coverity



Coverity reports a truncation due to cast operation on operand
reltab->sh_size from 64 bits to 32 bits for calls of load_at.

Fix the types of the function arguments to match their use in
function load_at: the offset is used for lseek which takes an
off_t parameter, the size is used for g_malloc and read.

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 b76d799e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ int load_aout(const char *filename, hwaddr addr, int max_sz,

/* ELF loader */

static void *load_at(int fd, int offset, int size)
static void *load_at(int fd, off_t offset, size_t size)
{
    void *ptr;
    if (lseek(fd, offset, SEEK_SET) < 0)