aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-08-13 18:46:09 +0200
committerGitHub <noreply@github.com>2017-08-13 18:46:09 +0200
commitd258ac8ed21b3a202212792688b237d0741f6844 (patch)
tree72e6157e1c7789f49cfdeb7f6629b66c38ebcf83 /src/nvim/os
parent3c8d063786285987876b4e5ca98b301037945868 (diff)
downloadrneovim-d258ac8ed21b3a202212792688b237d0741f6844.tar.gz
rneovim-d258ac8ed21b3a202212792688b237d0741f6844.tar.bz2
rneovim-d258ac8ed21b3a202212792688b237d0741f6844.zip
io: more guards against NULL filename (#7159)
References ac055d677aa9 References #4370
Diffstat (limited to 'src/nvim/os')
-rw-r--r--src/nvim/os/fs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index 6ac9d682d7..78627f8703 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -859,8 +859,11 @@ bool os_fileinfo(const char *path, FileInfo *file_info)
/// @param[out] file_info Pointer to a FileInfo to put the information in.
/// @return `true` on success, `false` for failure.
bool os_fileinfo_link(const char *path, FileInfo *file_info)
- FUNC_ATTR_NONNULL_ALL
+ FUNC_ATTR_NONNULL_ARG(2)
{
+ if (path == NULL) {
+ return false;
+ }
uv_fs_t request;
int result = uv_fs_lstat(&fs_loop, &request, path, NULL);
file_info->stat = request.statbuf;