aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2018-08-15 10:36:31 +0200
committerNikolaus Rath <Nikolaus@rath.org>2018-10-10 10:49:48 +0100
commit33e8796d56a0f102ec1928503c8be94741c4935e (patch)
treeb9b4fe34d7bbd9f78dd5a2cea9e2ebf9254c32e2
parent7c08db3f93c82a6d1bedb6a32740ef30896d86e6 (diff)
downloadlibfuse-33e8796d56a0f102ec1928503c8be94741c4935e.tar.gz
passthrough_ll: initialize unused memory
For '.' and '..' entries only the file type in e.attr.st_mode and the inode number in e.attr.st_ino are used. But it's prudent to at least initialize the other fields of struct fuse_entry_param as well, instead of using random values from the stack.
-rw-r--r--example/passthrough_ll.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/example/passthrough_ll.c b/example/passthrough_ll.c
index 80194f0..db4a3f3 100644
--- a/example/passthrough_ll.c
+++ b/example/passthrough_ll.c
@@ -702,9 +702,10 @@ static void lo_do_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
struct fuse_entry_param e;
if (is_dot_or_dotdot(name)) {
- e.ino = 0;
- e.attr.st_ino = d->entry->d_ino;
- e.attr.st_mode = d->entry->d_type << 12;
+ e = (struct fuse_entry_param) {
+ .attr.st_ino = d->entry->d_ino,
+ .attr.st_mode = d->entry->d_type << 12,
+ };
} else {
err = lo_do_lookup(req, ino, name, &e);
if (err)