From 6b596b8852d8fad2675894e3ceb18a04801eaf23 Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Wed, 11 May 2016 20:34:33 +0200 Subject: [PATCH] SIGSEGV and other signals could lead to a 100% CPU loop --- CHANGES | 3 +++ socat.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index ee15bd0..1e1bc5d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ +corrections: + SIGSEGV and other signals could lead to a 100% CPU loop + testing: socks4echo.sh and socks4a-echo.sh hung with new bash with read -n diff --git a/socat.c b/socat.c index 09039ff..ace006d 100644 --- a/socat.c +++ b/socat.c @@ -1422,12 +1422,13 @@ void socat_signal(int signum) { diag_in_handler = 1; Notice1("socat_signal(): handling signal %d", signum); switch (signum) { - case SIGQUIT: case SIGILL: case SIGABRT: case SIGBUS: case SIGFPE: case SIGSEGV: + diag_immediate_exit = 1; + case SIGQUIT: case SIGPIPE: diag_set_int('x', 128+signum); /* in case Error exits for us */ Error1("exiting on signal %d", signum);