diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2017-07-26 23:42:16 -0300 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2017-07-31 13:06:39 +0300 |
commit | 72cd500b725fd9a3bbefeb468d54c192fdc28318 (patch) | |
tree | 802a59ba8b96edd921b66b0db0fa4f0d56f74fa9 /linux-user/elfload.c | |
parent | 4b5660e403c9cae998dc70b51288968655977896 (diff) | |
download | qemu-72cd500b725fd9a3bbefeb468d54c192fdc28318.zip qemu-72cd500b725fd9a3bbefeb468d54c192fdc28318.tar.gz qemu-72cd500b725fd9a3bbefeb468d54c192fdc28318.tar.bz2 |
linux-user/sh4: fix incorrect memory write
not hit since 2009! :)
linux-user/elfload.c:1102:20: warning: Out of bound memory access (access exceeds upper limit of memory block)
(*regs[i]) = tswap32(env->gregs[i]);
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r-- | linux-user/elfload.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 2a902f7..7906288 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1099,7 +1099,7 @@ static inline void elf_core_copy_regs(target_elf_gregset_t *regs, int i; for (i = 0; i < 16; i++) { - (*regs[i]) = tswapreg(env->gregs[i]); + (*regs)[i] = tswapreg(env->gregs[i]); } (*regs)[TARGET_REG_PC] = tswapreg(env->pc); |