aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/alloca/needstack.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/alloca/needstack.c b/src/alloca/needstack.c
index 9fce7c2..149914c 100644
--- a/src/alloca/needstack.c
+++ b/src/alloca/needstack.c
@@ -54,6 +54,9 @@ int stack_will_overflow(intptr_t n)
sigset_t new_mask;
void* old_sigsegv_handler;
+ if (sigemptyset(&new_mask) || sigaddset(&new_mask, SIGSEGV))
+ return 1;
+
old_sigsegv_handler = signal(SIGSEGV, SIG_DFL);
if (old_sigsegv_handler == SIG_ERR)
return 1;