isdn/i4l: fix buffer overflow
[sfrench/cifs-2.6.git] / drivers / isdn / i4l / isdn_common.c
index 89b09c51ab7cff64d20e24ff43fff8bd720d1ef3..38a5bb764c7b55cb8b742639e49756e413b4ab26 100644 (file)
@@ -1376,6 +1376,7 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
                        if (arg) {
                                if (copy_from_user(bname, argp, sizeof(bname) - 1))
                                        return -EFAULT;
+                               bname[sizeof(bname)-1] = 0;
                        } else
                                return -EINVAL;
                        ret = mutex_lock_interruptible(&dev->mtx);