summaryrefslogtreecommitdiff
path: root/cmds-filesystem.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2015-06-12 14:36:51 +0200
committerDavid Sterba <dsterba@suse.cz>2015-06-12 16:44:48 +0200
commit6a039e5063fc96cc72a0a0b2bdc97403fb080de1 (patch)
tree162acdd186f1c1bbdba875ebf470f33a67f691e1 /cmds-filesystem.c
parent2e151027d245a762326dac8e814db9fc59113454 (diff)
downloadbtrfs-progs-6a039e5063fc96cc72a0a0b2bdc97403fb080de1.tar.gz
btrfs-progs: properly set up ioctl arguments
At some places we do not clear the whole ioctl structure and could pass garbage to kernel. Zero the ioctl vol_args and use a helper for copying the path. Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-filesystem.c')
-rw-r--r--cmds-filesystem.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index ccf89c6..dcd3f47 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -1270,6 +1270,7 @@ static int cmd_resize(int argc, char **argv)
}
printf("Resize '%s' of '%s'\n", path, amount);
+ memset(&args, 0, sizeof(args));
strncpy_null(args.name, amount);
res = ioctl(fd, BTRFS_IOC_RESIZE, &args);
e = errno;