aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2018-06-08 02:10:38 -0400
committerJustin M. Keyes <justinkz@gmail.com>2018-06-08 08:10:38 +0200
commitbe68f218ffef891fe4521d70cf52eceb93ef5d5e (patch)
tree1c0ed765069549dfe716c9651bcf3106248e453a /src/nvim/os
parent4871f26c220c5cedbe2f4fbf6cb379da91aef0c3 (diff)
downloadrneovim-be68f218ffef891fe4521d70cf52eceb93ef5d5e.tar.gz
rneovim-be68f218ffef891fe4521d70cf52eceb93ef5d5e.tar.bz2
rneovim-be68f218ffef891fe4521d70cf52eceb93ef5d5e.zip
vim-patch:8.0.0355: using uninitialized memory when 'isfname' is empty (#8493)
Problem: Using uninitialized memory when 'isfname' is empty. Solution: Don't call getpwnam() without an argument. (Dominique Pelle, closes vim/vim#1464) https://github.com/vim/vim/commit/187a4f28140f10ff833862be7e3ef823d317e1c7
Diffstat (limited to 'src/nvim/os')
-rw-r--r--src/nvim/os/users.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c
index 82bb918f70..7c48ac6e5e 100644
--- a/src/nvim/os/users.c
+++ b/src/nvim/os/users.c
@@ -76,7 +76,7 @@ char *os_get_user_directory(const char *name)
{
#if defined(HAVE_GETPWNAM) && defined(HAVE_PWD_H)
struct passwd *pw;
- if (name == NULL) {
+ if (name == NULL || *name == NUL) {
return NULL;
}
pw = getpwnam(name); // NOLINT(runtime/threadsafe_fn)