qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/5] linux-user: Fix sigismember() check


From: Aleksandar Markovic
Subject: [Qemu-devel] [PATCH 1/5] linux-user: Fix sigismember() check
Date: Wed, 22 May 2019 20:46:21 +0200

From: Miloš Stojanović <address@hidden>

Fix copying between the host and target signal sets for the case when
the target set is larger than the host set.

sigismember() returns 1 if the specified signal number is a member of
the specified signal set, but it can also return -1 if an error occurs
(e.g. an out of range signal number is specified). All non-zero values
would cause the signal to be added, so a comparison with 1 is added to
assure that only the signals which are really in the set get added to
the other set.

Signed-off-by: Miloš Stojanović <address@hidden>
Signed-off-by: Aleksandar Markovic <address@hidden>
---
 linux-user/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-user/signal.c b/linux-user/signal.c
index 44b2d3b..c08a7fe 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -116,7 +116,7 @@ void host_to_target_sigset_internal(target_sigset_t *d,
     int i;
     target_sigemptyset(d);
     for (i = 1; i <= TARGET_NSIG; i++) {
-        if (sigismember(s, i)) {
+        if (sigismember(s, i) == 1) {
             target_sigaddset(d, host_to_target_signal(i));
         }
     }
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]