summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-10-14 09:29:10 +0000
committernicm <nicm@openbsd.org>2009-10-14 09:29:10 +0000
commit62d48a74843bcd7a1854afce5862d12599a74ca9 (patch)
tree6fbf0bcb511682a1d5fcef9d020ed3ccf9e6834f /usr.bin/tmux/cmd.c
parentRemove a redundant if (maxpty == npty) in check_pty - this is also tested by (diff)
downloadwireguard-openbsd-62d48a74843bcd7a1854afce5862d12599a74ca9.tar.xz
wireguard-openbsd-62d48a74843bcd7a1854afce5862d12599a74ca9.zip
Don't allow cmd_lookup_client to test clients without a session.
Diffstat (limited to 'usr.bin/tmux/cmd.c')
-rw-r--r--usr.bin/tmux/cmd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c
index e2d290840b7..6bb4e9fe94f 100644
--- a/usr.bin/tmux/cmd.c
+++ b/usr.bin/tmux/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.24 2009/10/11 10:04:27 nicm Exp $ */
+/* $OpenBSD: cmd.c,v 1.25 2009/10/14 09:29:10 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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;