[Pkg-libvirt-commits] [libguestfs] 28/87: fuse: clear stat structs (RHBZ#660687).

Hilko Bengen bengen at moszumanska.debian.org
Wed Feb 19 21:10:06 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch debian
in repository libguestfs.

commit 6a633c063c7ab8580d9263cfbdf9506641c98ced
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Wed Jan 15 18:51:18 2014 +0100

    fuse: clear stat structs (RHBZ#660687).
    
    Not all the fields of struct stat are actually filled by us. This caused
    rubbish to appear in the microseconds fields, which were then used as
    base when changing atime/ctime (with e.g. touch), triggering EINVAL by
    futimens/utimensat when those rubbish values were out of the range
    allowed for microseconds.
    
    (cherry picked from commit 99d6e2c84ef490feb6ff2e37e4b0684f34bac554)
---
 src/fuse.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/fuse.c b/src/fuse.c
index 288c02a..dd4f139 100644
--- a/src/fuse.c
+++ b/src/fuse.c
@@ -175,6 +175,7 @@ mount_local_readdir (const char *path, void *buf, fuse_fill_dir_t filler,
         if (ss->val[i].ino >= 0) {
           struct stat statbuf;
 
+          memset (&statbuf, 0, sizeof statbuf);
           statbuf.st_dev = ss->val[i].dev;
           statbuf.st_ino = ss->val[i].ino;
           statbuf.st_mode = ss->val[i].mode;
@@ -255,6 +256,7 @@ mount_local_getattr (const char *path, struct stat *statbuf)
   if (r == NULL)
     RETURN_ERRNO;
 
+  memset (statbuf, 0, sizeof *statbuf);
   statbuf->st_dev = r->dev;
   statbuf->st_ino = r->ino;
   statbuf->st_mode = r->mode;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list