From 33e8796d56a0f102ec1928503c8be94741c4935e Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 15 Aug 2018 10:36:31 +0200 Subject: [PATCH] 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. --- example/passthrough_ll.c | 7 ++++--- 1 file 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) -- 2.30.2