Btrfs: ensure path name is null terminated at btrfs_control_ioctl
[sfrench/cifs-2.6.git] / fs / btrfs / super.c
index cbc9d0d2c12de42786da57c41ebbc9f0364ffabd..645fc81e2a948eab03431a08c0c4b062ce7fd25e 100644 (file)
@@ -2237,6 +2237,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
        vol = memdup_user((void __user *)arg, sizeof(*vol));
        if (IS_ERR(vol))
                return PTR_ERR(vol);
+       vol->name[BTRFS_PATH_NAME_MAX] = '\0';
 
        switch (cmd) {
        case BTRFS_IOC_SCAN_DEV: