]> granicus.if.org Git - vim/commitdiff
patch 8.2.1091: no check if opening a pty works v8.2.1091
authorBram Moolenaar <Bram@vim.org>
Mon, 29 Jun 2020 20:40:42 +0000 (22:40 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 29 Jun 2020 20:40:42 +0000 (22:40 +0200)
Problem:    No check if opening a pty works.
Solution:   Check for invalid file descriptor.

src/os_unix.c
src/version.c

index 095e3a78e2e72b5c596b5f1f917c77e0db5e0241..a82256c676ecde3b0cd6512ddf6d8cd3d3bdb8e3 100644 (file)
@@ -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();
index e4d869448462adc4fc08f560939c4cb061d8144a..82eb99036f7169698b4d066ce1b0749d6a0ead61 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1091,
 /**/
     1090,
 /**/