aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/divert
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-09-04 04:38:59 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-06 21:29:18 -0400
commit017d79ef0073fdb170dcf185dc4c2456a304d659 (patch)
tree6a1b6cadc0f43745a60840910c5e52d9d993ad9e /drivers/isdn/divert
parentca1cef3a3a8af961f504abfcf9e13dac088e1ad1 (diff)
isdn: potential buffer overflows
cs->ics.parm.setup.phone is a 32 character array. In each of these cases we're copying from a 35 character array into a 32 character array so we should use strlcpy() instead of strcpy(). Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/divert')
-rw-r--r--drivers/isdn/divert/isdn_divert.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/isdn/divert/isdn_divert.c b/drivers/isdn/divert/isdn_divert.c
index 70cf6bac7a5a..48e6d220f62c 100644
--- a/drivers/isdn/divert/isdn_divert.c
+++ b/drivers/isdn/divert/isdn_divert.c
@@ -77,7 +77,7 @@ static void deflect_timer_expire(ulong arg)
77 77
78 case DEFLECT_ALERT: 78 case DEFLECT_ALERT:
79 cs->ics.command = ISDN_CMD_REDIR; /* protocol */ 79 cs->ics.command = ISDN_CMD_REDIR; /* protocol */
80 strcpy(cs->ics.parm.setup.phone,cs->deflect_dest); 80 strlcpy(cs->ics.parm.setup.phone, cs->deflect_dest, sizeof(cs->ics.parm.setup.phone));
81 strcpy(cs->ics.parm.setup.eazmsn,"Testtext delayed"); 81 strcpy(cs->ics.parm.setup.eazmsn,"Testtext delayed");
82 divert_if.ll_cmd(&cs->ics); 82 divert_if.ll_cmd(&cs->ics);
83 spin_lock_irqsave(&divert_lock, flags); 83 spin_lock_irqsave(&divert_lock, flags);
@@ -251,7 +251,7 @@ int deflect_extern_action(u_char cmd, ulong callid, char *to_nr)
251 251
252 case 2: /* redir */ 252 case 2: /* redir */
253 del_timer(&cs->timer); 253 del_timer(&cs->timer);
254 strcpy(cs->ics.parm.setup.phone, to_nr); 254 strlcpy(cs->ics.parm.setup.phone, to_nr, sizeof(cs->ics.parm.setup.phone));
255 strcpy(cs->ics.parm.setup.eazmsn, "Testtext manual"); 255 strcpy(cs->ics.parm.setup.eazmsn, "Testtext manual");
256 ic.command = ISDN_CMD_REDIR; 256 ic.command = ISDN_CMD_REDIR;
257 if ((i = divert_if.ll_cmd(&ic))) 257 if ((i = divert_if.ll_cmd(&ic)))
@@ -480,7 +480,7 @@ static int isdn_divert_icall(isdn_ctrl *ic)
480 if (!cs->timer.expires) 480 if (!cs->timer.expires)
481 { strcpy(ic->parm.setup.eazmsn,"Testtext direct"); 481 { strcpy(ic->parm.setup.eazmsn,"Testtext direct");
482 ic->parm.setup.screen = dv->rule.screen; 482 ic->parm.setup.screen = dv->rule.screen;
483 strcpy(ic->parm.setup.phone,dv->rule.to_nr); 483 strlcpy(ic->parm.setup.phone, dv->rule.to_nr, sizeof(ic->parm.setup.phone));
484 cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */ 484 cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
485 cs->timer.expires = jiffies + (HZ * AUTODEL_TIME); 485 cs->timer.expires = jiffies + (HZ * AUTODEL_TIME);
486 retval = 5; 486 retval = 5;