Fix for execve syscall, by Kirill A. Shutemov.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3763 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
ths 2007-12-02 06:28:08 +00:00
parent e96e2044a1
commit 03aa197628
1 changed files with 4 additions and 4 deletions

View File

@ -3187,18 +3187,18 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
argc = 0; argc = 0;
guest_argp = arg2; guest_argp = arg2;
for (gp = guest_argp; ; gp++) { for (gp = guest_argp; ; gp++) {
if (get_user_ual(guest_argp, gp)) if (get_user_ual(addr, gp))
goto efault; goto efault;
if (!guest_argp) if (!addr)
break; break;
argc++; argc++;
} }
envc = 0; envc = 0;
guest_envp = arg3; guest_envp = arg3;
for (gp = guest_envp; ; gp++) { for (gp = guest_envp; ; gp++) {
if (get_user_ual(guest_envp, gp)) if (get_user_ual(addr, gp))
goto efault; goto efault;
if (!guest_envp) if (!addr)
break; break;
envc++; envc++;
} }