4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-03-04 14:06:13 +08:00

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 67bf89c4ce
commit 8ddd4c2ff6

View File

@ -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;