From 0a36de0580ac0b686c5f72910bd3f0f0853e54d9 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 8 May 2001 04:25:46 +0000 Subject: [PATCH] Fix a stupid segfault caused by dereferencing a NULL ptr. -Erik --- hush.c | 2 ++ shell/hush.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hush.c b/hush.c index a5f634b9a..1cb5f39ab 100644 --- a/hush.c +++ b/hush.c @@ -1162,6 +1162,8 @@ static void checkjobs() remove_bg_job(pi); } } else { + if(pi==NULL) + break; /* child stopped */ pi->stopped_progs++; pi->progs[prognum].is_stopped = 1; diff --git a/shell/hush.c b/shell/hush.c index a5f634b9a..1cb5f39ab 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -1162,6 +1162,8 @@ static void checkjobs() remove_bg_job(pi); } } else { + if(pi==NULL) + break; /* child stopped */ pi->stopped_progs++; pi->progs[prognum].is_stopped = 1; -- 2.25.1