summaryrefslogtreecommitdiffstats
path: root/cmd.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-10-14 13:22:24 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-10-14 13:22:24 +0000
commitf8f2421ac36dbcb8facdb30b25b837d81c6725ef (patch)
tree655680ed1484f348c3ad25e607ad04e3d4ec6718 /cmd.c
parent9e6d1b24c89928c2935e4c1e5263899cef3a0649 (diff)
Don't let cmd_lookup_client find clients w/o a session.
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd.c b/cmd.c
index a97e64d7..ddc2d214 100644
--- a/cmd.c
+++ b/cmd.c
@@ -1,4 +1,4 @@
-/* $Id: cmd.c,v 1.123 2009-10-12 00:35:08 tcunha Exp $ */
+/* $Id: cmd.c,v 1.124 2009-10-14 13:22:24 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -457,7 +457,8 @@ cmd_lookup_client(const char *name)
u_int i;
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
- if ((c = ARRAY_ITEM(&clients, i)) == NULL)
+ c = ARRAY_ITEM(&clients, i);
+ if (c == NULL || c->session == NULL)
continue;
path = c->tty.path;