diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 5ee9f453333..cb5f67db75b 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -860,7 +860,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext ) */ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) { - if (sig > sizeof(handlers) / sizeof(handlers[0])) return -1; + if (sig >= sizeof(handlers) / sizeof(handlers[0])) return -1; if (handlers[sig] != NULL) return -2; handlers[sig] = wsh; return 0; diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 3a41c8405cc..14c5260c148 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -732,7 +732,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext ) */ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) { - if (sig > sizeof(handlers) / sizeof(handlers[0])) return -1; + if (sig >= sizeof(handlers) / sizeof(handlers[0])) return -1; if (handlers[sig] != NULL) return -2; handlers[sig] = wsh; return 0; diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c index 886da863704..507490a5264 100644 --- a/dlls/ntdll/signal_powerpc.c +++ b/dlls/ntdll/signal_powerpc.c @@ -940,7 +940,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *sigcontext ) */ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) { - if (sig > sizeof(handlers) / sizeof(handlers[0])) return -1; + if (sig >= sizeof(handlers) / sizeof(handlers[0])) return -1; if (handlers[sig] != NULL) return -2; handlers[sig] = wsh; return 0; diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 1e88df31437..a79fd6eb47d 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -2762,7 +2762,7 @@ static void usr1_handler( int signal, siginfo_t *siginfo, void *ucontext ) */ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) { - if (sig > sizeof(handlers) / sizeof(handlers[0])) return -1; + if (sig >= sizeof(handlers) / sizeof(handlers[0])) return -1; if (handlers[sig] != NULL) return -2; handlers[sig] = wsh; return 0;