]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/isdn/i4l/isdn_common.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
[linux-2.6-omap-h63xx.git] / drivers / isdn / i4l / isdn_common.c
index c6df2925ebd0f0e03b2416618d493ddc8951be9c..9cef6fcf587b6baaef9df48c3616779262d6d3a9 100644 (file)
@@ -914,6 +914,9 @@ isdn_readbchan_tty(int di, int channel, struct tty_struct *tty, int cisco_hack)
                        dflag = 0;
                        count_pull = count_put = 0;
                        while ((count_pull < skb->len) && (len > 0)) {
+                               /* push every character but the last to the tty buffer directly */
+                               if ( count_put )
+                                       tty_insert_flip_char(tty, last, TTY_NORMAL);
                                len--;
                                if (dev->drv[di]->DLEflag & DLEmask) {
                                        last = DLE;
@@ -1515,6 +1518,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
                                        if (copy_from_user(&iocts, argp,
                                             sizeof(isdn_ioctl_struct)))
                                                return -EFAULT;
+                                       iocts.drvid[sizeof(iocts.drvid)-1] = 0;
                                        if (strlen(iocts.drvid)) {
                                                if ((p = strchr(iocts.drvid, ',')))
                                                        *p = 0;
@@ -1599,6 +1603,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
                                        if (copy_from_user(&iocts, argp,
                                             sizeof(isdn_ioctl_struct)))
                                                return -EFAULT;
+                                       iocts.drvid[sizeof(iocts.drvid)-1] = 0;
                                        if (strlen(iocts.drvid)) {
                                                drvidx = -1;
                                                for (i = 0; i < ISDN_MAX_DRIVERS; i++)
@@ -1643,7 +1648,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
                                        } else {
                                                p = (char __user *) iocts.arg;
                                                for (i = 0; i < 10; i++) {
-                                                       sprintf(bname, "%s%s",
+                                                       snprintf(bname, sizeof(bname), "%s%s",
                                                                strlen(dev->drv[drvidx]->msn2eaz[i]) ?
                                                                dev->drv[drvidx]->msn2eaz[i] : "_",
                                                                (i < 9) ? "," : "\0");
@@ -1673,6 +1678,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
                                        char *p;
                                        if (copy_from_user(&iocts, argp, sizeof(isdn_ioctl_struct)))
                                                return -EFAULT;
+                                       iocts.drvid[sizeof(iocts.drvid)-1] = 0;
                                        if (strlen(iocts.drvid)) {
                                                if ((p = strchr(iocts.drvid, ',')))
                                                        *p = 0;