Commit 982f3ab679dd60e2b7cc4c0038f72b59376171dc
1 parent
d1781191
Fix execve argc/envc counting, by Takashi Yoshii.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3788 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
2 additions
and
2 deletions
linux-user/syscall.c
| ... | ... | @@ -3190,7 +3190,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, |
| 3190 | 3190 | |
| 3191 | 3191 | argc = 0; |
| 3192 | 3192 | guest_argp = arg2; |
| 3193 | - for (gp = guest_argp; ; gp++) { | |
| 3193 | + for (gp = guest_argp; ; gp += sizeof(abi_ulong)) { | |
| 3194 | 3194 | if (get_user_ual(addr, gp)) |
| 3195 | 3195 | goto efault; |
| 3196 | 3196 | if (!addr) |
| ... | ... | @@ -3199,7 +3199,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, |
| 3199 | 3199 | } |
| 3200 | 3200 | envc = 0; |
| 3201 | 3201 | guest_envp = arg3; |
| 3202 | - for (gp = guest_envp; ; gp++) { | |
| 3202 | + for (gp = guest_envp; ; gp += sizeof(abi_ulong)) { | |
| 3203 | 3203 | if (get_user_ual(addr, gp)) |
| 3204 | 3204 | goto efault; |
| 3205 | 3205 | if (!addr) | ... | ... |