summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas <thomas@xteddy.org>2012-09-27 11:55:55 +0100
committerThomas <thomas@xteddy.org>2012-09-27 11:55:55 +0100
commit80b5c0e0768f938dcb80778e4db057333c74989e (patch)
tree92c6de80523796b678cf0838c1e584d6c868cd70
parent48750022c092396e1b9259119fcb9772d6e125f1 (diff)
parent7a3ec77dbdb43058bfd810ed7a63f645c8521ee0 (diff)
Merge branch 'obsd-master'
Sync from OpenBSD. * obsd-master: Do not leak file descriptor if not a tty, reported by Sebastien Marie.
-rw-r--r--server-client.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/server-client.c b/server-client.c
index c38d6d66..435cd068 100644
--- a/server-client.c
+++ b/server-client.c
@@ -911,8 +911,10 @@ server_client_msg_identify(
return;
}
- if (!isatty(fd))
- return;
+ if (!isatty(fd)) {
+ close(fd);
+ return;
+ }
data->term[(sizeof data->term) - 1] = '\0';
tty_init(&c->tty, c, fd, data->term);
if (data->flags & IDENTIFY_UTF8)