diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-03-04 09:02:32 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-03-04 09:02:32 +0000 |
commit | 43d904dbf396f5ce90e29915b416fd26e32c6c3e (patch) | |
tree | 192a95643e1327515e1dd8da568d2d3905b10cec /cmd.c | |
parent | 1da64bf786d2f139b822bc80ef6043443c0ea720 (diff) | |
download | rtmux-43d904dbf396f5ce90e29915b416fd26e32c6c3e.tar.gz rtmux-43d904dbf396f5ce90e29915b416fd26e32c6c3e.tar.bz2 rtmux-43d904dbf396f5ce90e29915b416fd26e32c6c3e.zip |
tty.path can be NULL, don't dereference it. From George Nachman.
Diffstat (limited to 'cmd.c')
-rw-r--r-- | cmd.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -326,9 +326,9 @@ cmd_current_session(struct cmd_q *cmdq, int prefer_unattached) return (c->session); /* - * If the name of the calling client's pty is know, build a list of the - * sessions that contain it and if any choose either the first or the - * newest. + * If the name of the calling client's pty is known, build a list of + * the sessions that contain it and if any choose either the first or + * the newest. */ path = c == NULL ? NULL : c->tty.path; if (path != NULL) { @@ -531,7 +531,7 @@ cmd_lookup_client(const char *name) for (i = 0; i < ARRAY_LENGTH(&clients); i++) { c = ARRAY_ITEM(&clients, i); - if (c == NULL || c->session == NULL) + if (c == NULL || c->session == NULL || c->tty.path == NULL) continue; path = c->tty.path; |