diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-03-19 14:12:50 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-03-19 14:12:50 +0100 |
commit | c0a1d7f3ad4d41b64c6c881bb8ad7c201f8439a3 (patch) | |
tree | 5291925706e16fc5cdefee59ce9beeb4fce5625e /src | |
parent | 943bb2b8eb80266a5de143feeab4c842c4b68c61 (diff) | |
download | vim-git-c0a1d7f3ad4d41b64c6c881bb8ad7c201f8439a3.tar.gz |
patch 7.4.1595v7.4.1595
Problem: Not checking for failed open(). (Coverity)
Solution: Check file descriptor not being negative.
Diffstat (limited to 'src')
-rw-r--r-- | src/os_unix.c | 6 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index a9c20c991..4cc9de7c4 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -5150,7 +5150,7 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options UNUSED) null_fd = open("/dev/null", O_RDWR | O_EXTRA, 0); /* set up stdin for the child */ - if (use_null_for_in) + if (use_null_for_in && null_fd >= 0) { close(0); ignored = dup(null_fd); @@ -5165,7 +5165,7 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options UNUSED) } /* set up stderr for the child */ - if (use_null_for_err) + if (use_null_for_err && null_fd >= 0) { close(2); ignored = dup(null_fd); @@ -5185,7 +5185,7 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options UNUSED) } /* set up stdout for the child */ - if (use_null_for_out) + if (use_null_for_out && null_fd >= 0) { close(0); ignored = dup(null_fd); diff --git a/src/version.c b/src/version.c index 06cec58dd..bc817d739 100644 --- a/src/version.c +++ b/src/version.c @@ -749,6 +749,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1595, +/**/ 1594, /**/ 1593, |