[hurd,commited] hurd: Reject raising invalid signals

Message ID 20200606233706.3875595-1-samuel.thibault@ens-lyon.org
State New
Headers show
Series
  • [hurd,commited] hurd: Reject raising invalid signals
Related show

Commit Message

Samuel Thibault June 6, 2020, 11:37 p.m.
* hurd/hurd-raise.c (_hurd_raise_signal): Return  EINVAL if signo <= 0
or signo >= NSI.
---
 hurd/hurd-raise.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.26.2

Patch

diff --git a/hurd/hurd-raise.c b/hurd/hurd-raise.c
index d53fd417d2..af464377b6 100644
--- a/hurd/hurd-raise.c
+++ b/hurd/hurd-raise.c
@@ -28,6 +28,9 @@  int
 _hurd_raise_signal (struct hurd_sigstate *ss,
 		    int signo, const struct hurd_signal_detail *detail)
 {
+  if (signo <= 0 || signo >= NSIG)
+    return EINVAL;
+
   if (ss == NULL)
     {
       ss = _hurd_self_sigstate ();