diff options
author | kib <kib@FreeBSD.org> | 2016-04-22 08:49:50 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-04-22 08:49:50 +0000 |
commit | 20def0a2480ffa6b4139792958e25b11b5fd48ab (patch) | |
tree | 113544141edb51379bb286a94b8cea114af999ad /sys/ddb | |
parent | d8b3896c2b849a5a60c0ff322b6f8b7e051ed25b (diff) | |
download | FreeBSD-src-20def0a2480ffa6b4139792958e25b11b5fd48ab.zip FreeBSD-src-20def0a2480ffa6b4139792958e25b11b5fd48ab.tar.gz |
MFC r298043:
Avoid NULL pointer dereference.
Diffstat (limited to 'sys/ddb')
-rw-r--r-- | sys/ddb/db_ps.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c index d28a060..efbc8dc 100644 --- a/sys/ddb/db_ps.c +++ b/sys/ddb/db_ps.c @@ -181,7 +181,8 @@ db_ps(db_expr_t addr, boolean_t hasaddr, db_expr_t count, char *modif) 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) |