aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2011-11-23 21:42:09 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-29 18:39:37 -0500
commit5dc5503f5a400be5a7dc611745a034f04b0679b8 (patch)
treeb717b567bd90f0f637d2d4ed48bea72567126a78 /drivers/isdn
parent746ae30f821a8533ffba7769e492f59a96fdbeec (diff)
isdn: avoid copying too long drvid
"cfg->drvid" comes from the user so there is a possibility they didn't NUL terminate it properly. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/i4l/isdn_net.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index 1f73d7f7e024..2339d7396b9e 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -2756,6 +2756,9 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg)
2756 char *c, 2756 char *c,
2757 *e; 2757 *e;
2758 2758
2759 if (strnlen(cfg->drvid, sizeof(cfg->drvid)) ==
2760 sizeof(cfg->drvid))
2761 return -EINVAL;
2759 drvidx = -1; 2762 drvidx = -1;
2760 chidx = -1; 2763 chidx = -1;
2761 strcpy(drvid, cfg->drvid); 2764 strcpy(drvid, cfg->drvid);