diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2021-11-22 12:19:02 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2021-11-22 12:37:12 +0100 |
commit | d54d8f173d66c7659061de664d445458737b4a75 (patch) | |
tree | 727329f0c7fabe3bde98e5fb617098c9e02ab627 /winsup | |
parent | f03222f242c5d1b94156ea91639c18de9197152a (diff) | |
download | newlib-d54d8f173d66c7659061de664d445458737b4a75.zip newlib-d54d8f173d66c7659061de664d445458737b4a75.tar.gz newlib-d54d8f173d66c7659061de664d445458737b4a75.tar.bz2 |
Cygwin: pthread_kill: check for invalid signal number
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/thread.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 7c6a919..fcfd75c 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; |