From: <lihua.zhao.cn@windriver.com>
To: <musl@lists.openwall.com>
Cc: <lihua.zhao.cn@windriver.com>
Subject: [musl] [PATCH] signal: check sigpause() input parameter
Date: Tue, 17 Dec 2024 21:15:14 +0800 [thread overview]
Message-ID: <20241217131514.3366368-1-lihua.zhao.cn@windriver.com> (raw)
From: Lihua Zhao <lihua.zhao.cn@windriver.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..a3644792 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 - 1) {
+ errno = EINVAL;
+ return -1;
+ }
sigprocmask(0, 0, &mask);
sigdelset(&mask, sig);
return sigsuspend(&mask);
--
2.43.0
next reply other threads:[~2024-12-17 13:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-17 13:15 lihua.zhao.cn [this message]
2024-12-18 2:49 ` [musl] [PATCH v2] " lihua.zhao.cn
2024-12-18 8:12 ` Markus Wichmann
2024-12-18 9:12 ` [musl] [PATCH v3] " lihua.zhao.cn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241217131514.3366368-1-lihua.zhao.cn@windriver.com \
--to=lihua.zhao.cn@windriver.com \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).