summaryrefslogtreecommitdiffstats
path: root/hw/core
diff options
context:
space:
mode:
authorStefan Weil2015-03-14 09:37:08 +0100
committerMichael Tokarev2015-03-19 09:36:52 +0100
commit6cbfb86f4c0ea7cbe852c7bc62a4ef523887c143 (patch)
treea76fd07c4ddf50fdb8213d183425f5f9fc9426ae /hw/core
parenthmp: Fix texinfo documentation (diff)
downloadqemu-6cbfb86f4c0ea7cbe852c7bc62a4ef523887c143.tar.gz
qemu-6cbfb86f4c0ea7cbe852c7bc62a4ef523887c143.tar.xz
qemu-6cbfb86f4c0ea7cbe852c7bc62a4ef523887c143.zip
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: Stefan Weil <sw@weilnetz.de> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/loader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 76d8acace9..d4c441fd18 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -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)