]> Git Repo - qemu.git/commitdiff
linux-user/sh4: fix incorrect memory write
authorPhilippe Mathieu-Daudé <[email protected]>
Thu, 27 Jul 2017 02:42:16 +0000 (23:42 -0300)
committerMichael Tokarev <[email protected]>
Mon, 31 Jul 2017 10:06:39 +0000 (13:06 +0300)
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é <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
linux-user/elfload.c

index 2a902f7806de902a5c251b39373ccefc74e4f465..79062882ba091d630b882703c8e56e24e4c39c43 100644 (file)
@@ -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);
This page took 0.024692 seconds and 4 git commands to generate.