From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 98B923858022; Mon, 22 Nov 2021 11:52:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98B923858022 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: pthread_kill: check for invalid signal number X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: f03222f242c5d1b94156ea91639c18de9197152a X-Git-Newrev: d54d8f173d66c7659061de664d445458737b4a75 Message-Id: <20211122115218.98B923858022@sourceware.org> Date: Mon, 22 Nov 2021 11:52:18 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2021 11:52:18 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=d54d8f173d66c7659061de664d445458737b4a75 commit d54d8f173d66c7659061de664d445458737b4a75 Author: Corinna Vinschen Date: Mon Nov 22 12:19:02 2021 +0100 Cygwin: pthread_kill: check for invalid signal number Signed-off-by: Corinna Vinschen Diff: --- 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;