Mercurial > vim
changeset 21079:ce4c58bc5e9e v8.2.1091
patch 8.2.1091: no check if opening a pty works
Commit: https://github.com/vim/vim/commit/d034220c54c63daaa2841e97b653842a47f5e90e
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jun 29 22:40:42 2020 +0200
patch 8.2.1091: no check if opening a pty works
Problem: No check if opening a pty works.
Solution: Check for invalid file descriptor.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 29 Jun 2020 22:45:07 +0200 |
parents | 5ec0c522a05c |
children | ab5c9907c56e |
files | src/os_unix.c src/version.c |
diffstat | 2 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os_unix.c +++ b/src/os_unix.c @@ -5922,6 +5922,8 @@ mch_create_pty_channel(job_T *job, jobop channel_T *channel; open_pty(&pty_master_fd, &pty_slave_fd, &job->jv_tty_out, &job->jv_tty_in); + if (pty_master_fd < 0 || pty_slave_fd < 0) + return FAIL; close(pty_slave_fd); channel = add_channel();