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:
Thomas 2012-09-27 11:55:55 +01:00
commit 80b5c0e076

View File

@ -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)