From d423acac6f52ebc2274f6b97ec8598e94626959f Mon Sep 17 00:00:00 2001 From: Matthew Mondor Date: Tue, 13 Jun 2023 11:44:05 +0000 Subject: [PATCH] AnalogTerm2: Check ttys != NULL in SIGCHLD handler. --- mmsoftware/analogterm2/src/tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmsoftware/analogterm2/src/tty.c b/mmsoftware/analogterm2/src/tty.c index c198ae7..86f452b 100644 --- a/mmsoftware/analogterm2/src/tty.c +++ b/mmsoftware/analogterm2/src/tty.c @@ -135,10 +135,10 @@ sighandler(int sig) warn("Shell subprocess %d exit status: %d %s", (int)pid, WEXITSTATUS(status), strerror(WEXITSTATUS(status))); - if (pid == ttys->shell_pid) + if (ttys != NULL && pid == ttys->shell_pid) ttys->shell_pid = -1; } - if (ttys->shell_pid == -1) { + if (ttys != NULL && ttys->shell_pid == -1) { warn("Shell subprocess gone."); shell_done = true; } -- 2.9.0