aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2013-07-02 14:04:12 +0100
committerRiku Voipio <riku.voipio@linaro.org>2013-07-05 15:45:40 +0300
commit167c50d8f94e0ffb880aa5cd2a232a3f32f0df1d (patch)
treeadec4f2495cc7c36b906e76ae77752ddd9b74e58 /linux-user
parent7ff7b666186a86f0121e6e7db6784222cefe22a2 (diff)
linux-user: fix signal number range check
When translating between host and target signal numbers keep negative numbers unchanged, avoiding access beyond array bounds. Signed-off-by: Andreas Schwab <schwab@linux-m68k.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 878v2b8sek.fsf@igel.home
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/signal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/linux-user/signal.c b/linux-user/signal.c
index c4e20dc8b9..d84e189bc8 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -102,14 +102,14 @@ static inline int sas_ss_flags(unsigned long sp)
int host_to_target_signal(int sig)
{
- if (sig >= _NSIG)
+ if (sig < 0 || sig >= _NSIG)
return sig;
return host_to_target_signal_table[sig];
}
int target_to_host_signal(int sig)
{
- if (sig >= _NSIG)
+ if (sig < 0 || sig >= _NSIG)
return sig;
return target_to_host_signal_table[sig];
}