[Pkg-libvirt-commits] [libguestfs] 50/233: fuse: clear stat structs (RHBZ#660687).
Hilko Bengen
bengen at moszumanska.debian.org
Wed Feb 19 21:10:52 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch experimental
in repository libguestfs.
commit 99d6e2c84ef490feb6ff2e37e4b0684f34bac554
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.
---
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