From adad5574996cabc2e91bd267d2a86b3c6cec584d Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 14 Oct 2009 09:29:10 +0000 Subject: [PATCH] Don't allow cmd_lookup_client to test clients without a session. --- cmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd.c b/cmd.c index 0fb1ff57..198daa84 100644 --- a/cmd.c +++ b/cmd.c @@ -458,7 +458,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;