From 4a32095f34340eb7d15ed63090992bbe6b7cb6ca Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Sat, 15 Jun 1996 07:08:02 +0000 Subject: A small bit of defensive programming in case the panic is during process exit and cleanup. the 'ps' command assumes that there are always 'nproc' processes on the lists and will walk off the end without checking if not, causing ddb to trap during the 'ps' command. --- sys/ddb/db_ps.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys/ddb') diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c index 780d4e6affc4..c2b03aa62db0 100644 --- a/sys/ddb/db_ps.c +++ b/sys/ddb/db_ps.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: db_ps.c,v 1.10 1995/12/10 19:08:08 bde Exp $ + * $Id: db_ps.c,v 1.11 1996/03/11 05:53:59 hsu Exp $ */ #include #include @@ -84,6 +84,10 @@ db_ps(dummy1, dummy2, dummy3, dummy4) return; } } + if (p == NULL) { + printf("oops, ran out of processes early!\n"); + break; + } pp = p->p_pptr; if (pp == NULL) pp = p; -- cgit v1.2.3