aboutsummaryrefslogtreecommitdiff
path: root/linux-user/syscall.c
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
commitda94d26390b292f2b9d90aee2936d8545364d5a2 (patch)
tree1969aa43980fae22639acea43b89fd18c91614ab /linux-user/syscall.c
parentf0cbb613331165d5b24760a0203d079be5dfce54 (diff)
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/syscall.c')
-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;