diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2018-08-15 10:36:31 +0200 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2018-10-10 10:49:48 +0100 |
commit | 33e8796d56a0f102ec1928503c8be94741c4935e (patch) | |
tree | b9b4fe34d7bbd9f78dd5a2cea9e2ebf9254c32e2 /example | |
parent | 7c08db3f93c82a6d1bedb6a32740ef30896d86e6 (diff) | |
download | libfuse-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.
Diffstat (limited to 'example')
-rw-r--r-- | example/passthrough_ll.c | 7 |
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) |