summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2013-03-25 10:04:44 +0000
committerNicholas Marriott <nicm@openbsd.org>2013-03-25 10:04:44 +0000
commite2e85650ac31a4814394e0bfe57b143de0b93e30 (patch)
tree3f33f6a2e18179ecd4e2c5504a4658402457497a
parent2c14a771a8c399f6a0e24bc619006c1dd85a7ede (diff)
tty.path can be NULL, don't dereference it. From George Nachman.
-rw-r--r--cmd-choose-client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd-choose-client.c b/cmd-choose-client.c
index b32703c4..df57f9cf 100644
--- a/cmd-choose-client.c
+++ b/cmd-choose-client.c
@@ -79,7 +79,7 @@ cmd_choose_client_exec(struct cmd *self, struct cmd_q *cmdq)
cur = idx = 0;
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
c1 = ARRAY_ITEM(&clients, i);
- if (c1 == NULL || c1->session == NULL)
+ if (c1 == NULL || c1->session == NULL || c1->tty.path == NULL)
continue;
if (c1 == cmdq->client)
cur = idx;