From d54d8f173d66c7659061de664d445458737b4a75 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 22 Nov 2021 12:19:02 +0100 Subject: [PATCH] Cygwin: pthread_kill: check for invalid signal number Signed-off-by: Corinna Vinschen --- winsup/cygwin/thread.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 7c6a919c0..fcfd75c79 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -3351,6 +3351,10 @@ pthread_kill (pthread_t thread, int sig) if (!pthread::is_good_object (&thread)) return EINVAL; + /* check that sig is in right range */ + if (sig < 0 || sig >= _NSIG) + return EINVAL; + siginfo_t si = {0}; si.si_signo = sig; si.si_code = SI_USER; -- 2.43.5