svn commit: r298466 - stable/9/sys/ddb

Konstantin Belousov kib at FreeBSD.org
Fri Apr 22 08:56:49 UTC 2016


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)


More information about the svn-src-stable-9 mailing list