Author: kib
Date: Fri Apr 22 08:49:50 2016
New Revision: 298465
URL: https://svnweb.freebsd.org/changeset/base/298465

Log:
  MFC r298043:
  Avoid NULL pointer dereference.

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

Modified: stable/10/sys/ddb/db_ps.c
==============================================================================
--- stable/10/sys/ddb/db_ps.c   Fri Apr 22 08:11:26 2016        (r298464)
+++ stable/10/sys/ddb/db_ps.c   Fri Apr 22 08:49:50 2016        (r298465)
@@ -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)
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to