|
Message-ID: <20241218024952.3377660-1-lihua.zhao.cn@windriver.com> Date: Wed, 18 Dec 2024 10:49:52 +0800 From: <lihua.zhao.cn@...driver.com> To: <musl@...ts.openwall.com> CC: <lihua.zhao.cn@...driver.com> Subject: [PATCH v2] signal: check sigpause() input parameter From: Lihua Zhao <lihua.zhao.cn@...driver.com> --- src/signal/sigpause.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/signal/sigpause.c b/src/signal/sigpause.c index 363d2fec..8bd05f58 100644 --- a/src/signal/sigpause.c +++ b/src/signal/sigpause.c @@ -1,8 +1,13 @@ #include <signal.h> +#include <errno.h> int sigpause(int sig) { sigset_t mask; + if (sig < 1 || sig >= _NSIG) { + errno = EINVAL; + return -1; + } sigprocmask(0, 0, &mask); sigdelset(&mask, sig); return sigsuspend(&mask); -- 2.34.1
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.