Fix execve argc/envc counting, by Takashi Yoshii.
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 9 Dec 2007 23:12:55 +0000 (23:12 +0000)
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 9 Dec 2007 23:12:55 +0000 (23:12 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3788 c046a42c-6fe2-441c-8c8c-71466251a162

linux-user/syscall.c

index 590c72f..0deb041 100644 (file)
@@ -3190,7 +3190,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
 
             argc = 0;
             guest_argp = arg2;
-            for (gp = guest_argp; ; gp++) {
+            for (gp = guest_argp; ; gp += sizeof(abi_ulong)) {
                 if (get_user_ual(addr, gp))
                     goto efault;
                 if (!addr)
@@ -3199,7 +3199,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
             }
             envc = 0;
             guest_envp = arg3;
-            for (gp = guest_envp; ; gp++) {
+            for (gp = guest_envp; ; gp += sizeof(abi_ulong)) {
                 if (get_user_ual(addr, gp))
                     goto efault;
                 if (!addr)