From 65347c05120cc72eb8a34a67b940d817372743ae Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 28 Oct 2016 10:07:43 +0300 Subject: [PATCH] Fix 'address of fudged_set is used out of scope' code defect (sigmask) (fix commit 81d04a6) * pthread_support.c [!GC_NO_PTHREAD_SIGMASK] (pthread_sigmask): Move fudged_set to the outer scope where REAL_FUNC(pthread_sigmask) is called (a pointer to fudged_set could be passed to the latter function). --- pthread_support.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pthread_support.c b/pthread_support.c index 1b6a302..86e6c44 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -1243,11 +1243,13 @@ GC_INNER void GC_init_parallel(void) GC_API int WRAP_FUNC(pthread_sigmask)(int how, const sigset_t *set, sigset_t *oset) { + sigset_t fudged_set; + INIT_REAL_SYMS(); if (set != NULL && (how == SIG_BLOCK || how == SIG_SETMASK)) { - sigset_t fudged_set = *set; int sig_suspend = GC_get_suspend_signal(); + fudged_set = *set; GC_ASSERT(sig_suspend >= 0); if (sigdelset(&fudged_set, sig_suspend) != 0) ABORT("sigdelset failed"); -- 2.7.4