From 2b30ab7137da331d8ead24d244b8feb3e1028152 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Wed, 23 Nov 2011 13:45:47 +0000 Subject: linuxthreads/signals: do not restore handler for invalid signal Invalid signals have no handlers so when trying to restore the old handler to a bad signal a SIGSEGV occurs. This is because the library tries to store the old handler to an invalid memory area where it things the bad signal lives. URL: https://bugs.busybox.net/show_bug.cgi?id=4640 Signed-off-by: Markos Chandras Signed-off-by: Mike Frysinger --- libpthread/linuxthreads/signals.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpthread') diff --git a/libpthread/linuxthreads/signals.c b/libpthread/linuxthreads/signals.c index c08125579..61b411aba 100644 --- a/libpthread/linuxthreads/signals.c +++ b/libpthread/linuxthreads/signals.c @@ -113,7 +113,7 @@ int __pthread_sigaction(int sig, const struct sigaction * act, newactp = NULL; if (__libc_sigaction(sig, newactp, oact) == -1) { - if (act) + if (act && (sig > 0 && sig < NSIG)) __sighandler[sig].old = (arch_sighandler_t) old; return -1; } -- cgit v1.2.3