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>
Tue, 22 Jul 2014 04:31:23 +0000 (06:31 +0200)
to zero in all cases.

Reported by Daniel Iwan.

ChangeLog
lib/fuse.c

index da3b11a28908578bda89321348d68939a380aafc..4c3d13621a75fca4b18d2ec4dd01aedb76e97e0b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        result in EINVAL when mounting the filesystem.  This also needs a
        fix in the kernel.
 
+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
+
 2013-08-26  Miklos Szeredi <miklos@szeredi.hu>
 
        * libfuse: Add missing includes.  This allows compiling fuse with
index 7ba654a39c6a8515fd7abb26e4d90efd0e697df8..fa0a8149bcdaf74df2d076e9b0e0e1097d990a21 100644 (file)
@@ -2396,6 +2396,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;
@@ -2769,6 +2770,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);