summaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-30 18:24:00 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-30 18:24:00 +0000
commitfaebfa5a21ea279c2d4c7198a83928f2430ea6f6 (patch)
tree1969aa43980fae22639acea43b89fd18c91614ab /linux-user
parent3ce99772a56700675e1b80cf13d2760a1ab5ac0e (diff)
downloadqemu-faebfa5a21ea279c2d4c7198a83928f2430ea6f6.tar.gz
qemu-faebfa5a21ea279c2d4c7198a83928f2430ea6f6.tar.bz2
qemu-faebfa5a21ea279c2d4c7198a83928f2430ea6f6.zip
Handle NULL argp/envp in execve syscall.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4627 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 618e57ef23..0654f07a65 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3248,7 +3248,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
argc = 0;
guest_argp = arg2;
- for (gp = guest_argp; ; gp += sizeof(abi_ulong)) {
+ for (gp = guest_argp; gp; gp += sizeof(abi_ulong)) {
if (get_user_ual(addr, gp))
goto efault;
if (!addr)
@@ -3257,7 +3257,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
}
envc = 0;
guest_envp = arg3;
- for (gp = guest_envp; ; gp += sizeof(abi_ulong)) {
+ for (gp = guest_envp; gp; gp += sizeof(abi_ulong)) {
if (get_user_ual(addr, gp))
goto efault;
if (!addr)
@@ -3268,7 +3268,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
argp = alloca((argc + 1) * sizeof(void *));
envp = alloca((envc + 1) * sizeof(void *));
- for (gp = guest_argp, q = argp; ;
+ for (gp = guest_argp, q = argp; gp;
gp += sizeof(abi_ulong), q++) {
if (get_user_ual(addr, gp))
goto execve_efault;
@@ -3279,7 +3279,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
}
*q = NULL;
- for (gp = guest_envp, q = envp; ;
+ for (gp = guest_envp, q = envp; gp;
gp += sizeof(abi_ulong), q++) {
if (get_user_ual(addr, gp))
goto execve_efault;