Patch 8.2.3544

5 views
Skip to first unread message

Bram Moolenaar

unread,
Oct 20, 2021, 5:00:52 AM10/20/21
to vim...@googlegroups.com

Patch 8.2.3544
Problem: Unix: may leak file descriptor when using a non-existing
directory.
Solution: Always close the file. (closes #9023)
Files: src/os_unix.c


*** ../vim-8.2.3543/src/os_unix.c 2021-10-13 10:05:26.863362862 +0100
--- src/os_unix.c 2021-10-20 09:55:51.306497212 +0100
***************
*** 2681,2687 ****
verbose_leave();
}
l = fchdir(fd);
- close(fd);
}
else
#endif
--- 2681,2686 ----
***************
*** 2689,2694 ****
--- 2688,2697 ----
if (l != 0)
emsg(_(e_prev_dir));
}
+ #ifdef HAVE_FCHDIR
+ if (fd >= 0)
+ close(fd);
+ #endif

l = STRLEN(buf);
if (l >= len - 1)
*** ../vim-8.2.3543/src/version.c 2021-10-19 22:12:21.936582330 +0100
--- src/version.c 2021-10-20 09:57:21.899860581 +0100
***************
*** 759,760 ****
--- 759,762 ----
{ /* Add new patch number below this line */
+ /**/
+ 3544,
/**/

--
hundred-and-one symptoms of being an internet addict:
203. You're an active member of more than 20 newsgroups.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages