Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0f13864e5b24d9cbe18d125d41bfa4b726a82e40
Commit:     0f13864e5b24d9cbe18d125d41bfa4b726a82e40
Parent:     552d2f841e3f0f45eac86ff93e230db0b0a67a99
Author:     Karsten Keil <[EMAIL PROTECTED]>
AuthorDate: Thu Nov 22 12:43:13 2007 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Nov 26 19:08:18 2007 -0800

    isdn: avoid copying overly-long strings
    
    Addresses http://bugzilla.kernel.org/show_bug.cgi?id=9416
    
    Signed-off-by: Karsten Keil <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/isdn/i4l/isdn_net.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index b39d1f5..ced83c2 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -2104,7 +2104,7 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm 
*setup)
        u_long flags;
        isdn_net_dev *p;
        isdn_net_phone *n;
-       char nr[32];
+       char nr[ISDN_MSNLEN];
        char *my_eaz;
 
        /* Search name in netdev-chain */
@@ -2113,7 +2113,7 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm 
*setup)
                nr[1] = '\0';
                printk(KERN_INFO "isdn_net: Incoming call without OAD, assuming 
'0'\n");
        } else
-               strcpy(nr, setup->phone);
+               strlcpy(nr, setup->phone, ISDN_MSNLEN);
        si1 = (int) setup->si1;
        si2 = (int) setup->si2;
        if (!setup->eazmsn[0]) {
@@ -2789,7 +2789,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg)
                                chidx = -1;
                        }
                }
-               strcpy(lp->msn, cfg->eaz);
+               strlcpy(lp->msn, cfg->eaz, sizeof(lp->msn));
                lp->pre_device = drvidx;
                lp->pre_channel = chidx;
                lp->onhtime = cfg->onhtime;
@@ -2936,7 +2936,7 @@ isdn_net_addphone(isdn_net_ioctl_phone * phone)
        if (p) {
                if (!(n = kmalloc(sizeof(isdn_net_phone), GFP_KERNEL)))
                        return -ENOMEM;
-               strcpy(n->num, phone->phone);
+               strlcpy(n->num, phone->phone, sizeof(n->num));
                n->next = p->local->phone[phone->outgoing & 1];
                p->local->phone[phone->outgoing & 1] = n;
                return 0;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to