Cygwin: pthread_kill: check for invalid signal number

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2021-11-22 12:19:02 +01:00
parent f03222f242
commit d54d8f173d
1 changed files with 4 additions and 0 deletions

View File

@ -3351,6 +3351,10 @@ pthread_kill (pthread_t thread, int sig)
if (!pthread::is_good_object (&thread)) if (!pthread::is_good_object (&thread))
return EINVAL; return EINVAL;
/* check that sig is in right range */
if (sig < 0 || sig >= _NSIG)
return EINVAL;
siginfo_t si = {0}; siginfo_t si = {0};
si.si_signo = sig; si.si_signo = sig;
si.si_code = SI_USER; si.si_code = SI_USER;