mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2024-11-16 08:44:31 +08:00
mkfs: avoid heap-buffer-read-underrun for zero-length "size" arg
* mkfs.c (parse_size): ./mkfs.btrfs -A '' would read and possibly write the byte before beginning of strdup'd heap buffer. All other size-accepting options were similarly affected. Reviewed-by: Josef Bacik <josef@redhat.com>
This commit is contained in:
parent
54e345b5c2
commit
8ad8e789fc
@ -380,7 +380,7 @@ static int cmd_snapshot(int argc, char **argv)
|
||||
|
||||
args.fd = fd;
|
||||
strncpy(args.name, newname, BTRFS_SUBVOL_NAME_MAX);
|
||||
args.name[BTRFS_PATH_NAME_MAX-1] = 0;
|
||||
args.name[BTRFS_SUBVOL_NAME_MAX-1] = 0;
|
||||
res = ioctl(fddst, BTRFS_IOC_SNAP_CREATE_V2, &args);
|
||||
e = errno;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user