Merge pull request #163 from saschagrunert/segfault

Fix possible segmentation fault in direct_fsync()
This commit is contained in:
Giuseppe Scrivano 2020-01-08 13:25:41 +01:00 committed by GitHub
commit 9f27377e13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
main.c
View File

@ -4593,6 +4593,12 @@ do_fsync (fuse_req_t req, fuse_ino_t ino, int datasync, int fd)
/* Skip fsync for lower layers. */
do_fsync = node && node->layer == get_upper_layer (lo);
if (node->layer == NULL)
{
fuse_reply_err (req, ENOENT);
return;
}
if (fd < 0)
strcpy (path, node->path);