mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 23:18:33 +00:00
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)
187a4f2814
This commit is contained in:

committed by
Justin M. Keyes

parent
4871f26c22
commit
be68f218ff
@@ -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)
|
||||
|
Reference in New Issue
Block a user