From f83fa3c95e9ac6badc393c198c8bc08bc45bea96 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 25 Sep 2013 08:56:15 +0200 Subject: [PATCH] Fix a crash in QProcess signal handling on Mac. On Mac, SA_SIGINFO can be set while the handler is SIG_DFL. Change-Id: Ibaeaa1612e27217826841d7400309c45b5a101ea Initial-patch-by: Thiago Macieira Reviewed-by: Thiago Macieira --- src/corelib/io/qprocess_unix.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index eab3890beb..3c6d294916 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -141,7 +141,8 @@ static void qt_sa_sigchld_sigaction(int signum, siginfo_t *info, void *context) if (qt_sa_old_sigchld_handler.sa_flags & SA_SIGINFO) { void (*oldAction)(int, siginfo_t *, void *) = vsa->sa_sigaction; - oldAction(signum, info, context); + if (oldAction) + oldAction(signum, info, context); } else { void (*oldAction)(int) = vsa->sa_handler;