summaryrefslogtreecommitdiff
path: root/src/os_unix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-06-29 22:40:42 +0200
committerBram Moolenaar <Bram@vim.org>2020-06-29 22:40:42 +0200
commitd034220c54c63daaa2841e97b653842a47f5e90e (patch)
tree543086bef7913636c1fdd843e086198e8d9c0dcf /src/os_unix.c
parent9b5384b97e832958573ffdcd3c1e230635b434e4 (diff)
downloadvim-git-d034220c54c63daaa2841e97b653842a47f5e90e.tar.gz
patch 8.2.1091: no check if opening a pty worksv8.2.1091
Problem: No check if opening a pty works. Solution: Check for invalid file descriptor.
Diffstat (limited to 'src/os_unix.c')
-rw-r--r--src/os_unix.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/os_unix.c b/src/os_unix.c
index 095e3a78e..a82256c67 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -5922,6 +5922,8 @@ mch_create_pty_channel(job_T *job, jobopt_T *options)
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();