Initilaize stat buffer passed to ->getattr() and ->fgetattr()
authorMiklos Szeredi <mszeredi@suse.cz>
Wed, 26 Mar 2014 15:46:38 +0000 (16:46 +0100)
committerMiklos Szeredi <mszeredi@suse.cz>
Wed, 26 Mar 2014 15:46:38 +0000 (16:46 +0100)
to zero in all cases.

Reported by Daniel Iwan.

ChangeLog
lib/fuse.c

index 9932a7c610cae6a03ef0d26de5598607945caab7..810059983ff7981a0d970bb9d159766329276fbd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-26  Miklos Szeredi <miklos@szeredi.hu>
+
+       * Initilaize stat buffer passed to ->getattr() and ->fgetattr() to
+       zero in all cases.  Reported by Daniel Iwan
+
 2014-03-05  Miklos Szeredi <miklos@szeredi.hu>
 
        * libfuse: implement readdirplus for high-level API.  Reuse the
index c9c36ad02ee659870ec3a73c5a40c39f4160d32c..ca6d3cd04a130661e90f7735e7ac300d39798b10 100644 (file)
@@ -2278,6 +2278,7 @@ static char *hidden_name(struct fuse *f, fuse_ino_t dir, const char *oldname,
                if (res)
                        break;
 
+               memset(&buf, 0, sizeof(buf));
                res = fuse_fs_getattr(f->fs, newpath, &buf);
                if (res == -ENOENT)
                        break;
@@ -2659,6 +2660,7 @@ static void fuse_lib_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr,
        char *path;
        int err;
 
+       memset(&buf, 0, sizeof(buf));
        if (valid == FUSE_SET_ATTR_SIZE && fi != NULL &&
            f->fs->op.ftruncate && f->fs->op.fgetattr)
                err = get_path_nullok(f, ino, &path);