Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Apr 2016 08:56:48 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r298466 - stable/9/sys/ddb
Message-ID:  <201604220856.u3M8umD8052173@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Apr 22 08:56:47 2016
New Revision: 298466
URL: https://svnweb.freebsd.org/changeset/base/298466

Log:
  MFC r298043:
  Avoid NULL pointer dereference.

Modified:
  stable/9/sys/ddb/db_ps.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/ddb/db_ps.c
==============================================================================
--- stable/9/sys/ddb/db_ps.c	Fri Apr 22 08:49:50 2016	(r298465)
+++ stable/9/sys/ddb/db_ps.c	Fri Apr 22 08:56:47 2016	(r298466)
@@ -181,7 +181,8 @@ db_ps(db_expr_t addr, boolean_t hasaddr,
 			strlcat(state, "V", sizeof(state));
 		if (p->p_flag & P_SYSTEM || p->p_lock > 0)
 			strlcat(state, "L", sizeof(state));
-		if (p->p_session != NULL && SESS_LEADER(p))
+		if (p->p_pgrp != NULL && p->p_session != NULL &&
+		    SESS_LEADER(p))
 			strlcat(state, "s", sizeof(state));
 		/* Cheated here and didn't compare pgid's. */
 		if (p->p_flag & P_CONTROLT)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604220856.u3M8umD8052173>