|
@@ -17,10 +17,6 @@ void __get_handler_set(sigset_t *set)
|
|
int __libc_sigaction(int sig, const struct sigaction *restrict sa, struct sigaction *restrict old)
|
|
int __libc_sigaction(int sig, const struct sigaction *restrict sa, struct sigaction *restrict old)
|
|
{
|
|
{
|
|
struct k_sigaction ksa, ksa_old;
|
|
struct k_sigaction ksa, ksa_old;
|
|
- if (sig >= (unsigned)_NSIG) {
|
|
|
|
- errno = EINVAL;
|
|
|
|
- return -1;
|
|
|
|
- }
|
|
|
|
if (sa) {
|
|
if (sa) {
|
|
if ((uintptr_t)sa->sa_handler > 1UL) {
|
|
if ((uintptr_t)sa->sa_handler > 1UL) {
|
|
a_or_l(handler_set+(sig-1)/(8*sizeof(long)),
|
|
a_or_l(handler_set+(sig-1)/(8*sizeof(long)),
|
|
@@ -57,7 +53,7 @@ int __libc_sigaction(int sig, const struct sigaction *restrict sa, struct sigact
|
|
|
|
|
|
int __sigaction(int sig, const struct sigaction *restrict sa, struct sigaction *restrict old)
|
|
int __sigaction(int sig, const struct sigaction *restrict sa, struct sigaction *restrict old)
|
|
{
|
|
{
|
|
- if (sig-32U < 3) {
|
|
|
|
|
|
+ if (sig-32U < 3 || sig-1U >= _NSIG-1) {
|
|
errno = EINVAL;
|
|
errno = EINVAL;
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|