summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads/signals.c
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2011-11-23 13:45:47 +0000
committerMike Frysinger <vapier@gentoo.org>2012-01-14 19:36:07 -0500
commit2b30ab7137da331d8ead24d244b8feb3e1028152 (patch)
treefbea08412b940c8368ee0f3289e838006df3732e /libpthread/linuxthreads/signals.c
parenta899b909abe14e8e35a81997c828201d1beaff78 (diff)
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 <markos.chandras@imgtec.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libpthread/linuxthreads/signals.c')
-rw-r--r--libpthread/linuxthreads/signals.c2
1 files changed, 1 insertions, 1 deletions
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;
}