diff options
author | Leon Timmermans <fawaka@gmail.com> | 2011-02-24 21:34:40 +0000 |
---|---|---|
committer | Chris 'BinGOs' Williams <chris@bingosnet.co.uk> | 2011-02-24 21:34:40 +0000 |
commit | b3dbdd48ca2da90bce7f16d545cca54c3dc58f35 (patch) | |
tree | 62f5d13eb693d0512df0dc40292af3cea7290ecc /mg.c | |
parent | 01c10dac6aeb4d749cce74f4d59961b729ad06af (diff) | |
download | perl-b3dbdd48ca2da90bce7f16d545cca54c3dc58f35.tar.gz |
Detect unsafe signals more reliably on BSD/Solaris
Previous versions of the Posix spec allowed the struct siginfo_t*
parameter passed to the signal handler to be NULL in certain cases. More
recent Posix specifications (SUSv3) have rescinded this: Now this
parameter is required always to be non-NULL. However we use this
parameter to differentiate between safe and unsafe signals, as in the
former it will always be NULL and in the latter case it should have been
non-NULL.
This patch fixes this issue by also relying on the ucontext_t*
parameter. This should reliably be non-NULL when using unsafe signals
handlers.
Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3001,7 +3001,7 @@ Perl_whichsig(pTHX_ const char *sig) Signal_t #if defined(HAS_SIGACTION) && defined(SA_SIGINFO) -Perl_sighandler(int sig, siginfo_t *sip, void *uap PERL_UNUSED_DECL) +Perl_sighandler(int sig, siginfo_t *sip, void *uap) #else Perl_sighandler(int sig) #endif @@ -3113,7 +3113,7 @@ Perl_sighandler(int sig) */ #ifdef HAS_SIGPROCMASK #if defined(HAS_SIGACTION) && defined(SA_SIGINFO) - if (sip) + if (sip || uap) #endif { sigset_t set; |