mirror of
https://github.com/tmux/tmux.git
synced 2025-01-14 20:58:53 +00: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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isatty(fd))
|
if (!isatty(fd)) {
|
||||||
return;
|
close(fd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
data->term[(sizeof data->term) - 1] = '\0';
|
data->term[(sizeof data->term) - 1] = '\0';
|
||||||
tty_init(&c->tty, c, fd, data->term);
|
tty_init(&c->tty, c, fd, data->term);
|
||||||
if (data->flags & IDENTIFY_UTF8)
|
if (data->flags & IDENTIFY_UTF8)
|
||||||
|
Loading…
Reference in New Issue
Block a user