From: Hugo Mills Date: Sun, 12 Jun 2011 20:52:39 +0000 (+0100) Subject: btrfs-progs: Fix over-sized limit on buffer X-Git-Tag: v0.20-rc1~109 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dfa328ac4e3e077a8972c171715cb64976e8d0f3;p=platform%2Fupstream%2Fbtrfs-progs.git btrfs-progs: Fix over-sized limit on buffer gcc-4.4 complains (rightly) that the strncpy has a limit too large for the array it's copying into. Use the correct array length. Signed-off-by: Hugo Mills --- diff --git a/btrfs_cmds.c b/btrfs_cmds.c index 505322d6..da5bd918 100644 --- a/btrfs_cmds.c +++ b/btrfs_cmds.c @@ -427,7 +427,7 @@ int do_clone(int argc, char **argv) } args.fd = fd; - strncpy(args.name, newname, BTRFS_PATH_NAME_MAX); + strncpy(args.name, newname, BTRFS_SUBVOL_NAME_MAX); res = ioctl(fddst, BTRFS_IOC_SNAP_CREATE_V2, &args); e = errno;