mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-27 18:43:11 +01:00
Merge branch 'obsd-master'
Sync from OpenBSD. * obsd-master: Do not leak file descriptor if not a tty, reported by Sebastien Marie.
This commit is contained in:
commit
80b5c0e076
@ -911,8 +911,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