mirror of
https://github.com/tmate-io/tmate.git
synced 2024-12-23 23:29:15 +01:00
Do not leak file descriptor if not a tty, reported by Sebastien Marie.
This commit is contained in:
parent
17bbf90393
commit
7a3ec77dbd
@ -912,8 +912,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)
|
||||
|
Loading…
Reference in New Issue
Block a user