Patchwork [12/18] linux-user: syscall should use sanitized arg1

login
register
mail settings
Submitter Riku Voipio
Date June 20, 2011, 4:20 p.m.
Message ID <7fa10eeb2066390526974ead1351ce117e4c5f06.1308583801.git.riku.voipio@iki.fi>
Download mbox | patch
Permalink /patch/101153/
State New
Headers show

Comments

Riku Voipio - June 20, 2011, 4:20 p.m.
From: Juan Quintela <quintela@redhat.com>

Looking at the other architectures, we should be using "how" not "arg1".

Signed-off-by: Juan Quintela <quintela@redhat.com>
[peter.maydell@linaro.org: remove unnecessary initialisation of how]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 linux-user/syscall.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 57d9233..1c0503f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7181,7 +7181,7 @@  abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_osf_sigprocmask:
         {
             abi_ulong mask;
-            int how = arg1;
+            int how;
             sigset_t set, oldset;
 
             switch(arg1) {
@@ -7200,7 +7200,7 @@  abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
             }
             mask = arg2;
             target_to_host_old_sigset(&set, &mask);
-            sigprocmask(arg1, &set, &oldset);
+            sigprocmask(how, &set, &oldset);
             host_to_target_old_sigset(&mask, &oldset);
             ret = mask;
         }