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>
This commit is contained in:
parent
746ae30f82
commit
5dc5503f5a
1 changed files with 3 additions and 0 deletions
|
@ -2756,6 +2756,9 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg)
|
||||||
char *c,
|
char *c,
|
||||||
*e;
|
*e;
|
||||||
|
|
||||||
|
if (strnlen(cfg->drvid, sizeof(cfg->drvid)) ==
|
||||||
|
sizeof(cfg->drvid))
|
||||||
|
return -EINVAL;
|
||||||
drvidx = -1;
|
drvidx = -1;
|
||||||
chidx = -1;
|
chidx = -1;
|
||||||
strcpy(drvid, cfg->drvid);
|
strcpy(drvid, cfg->drvid);
|
||||||
|
|
Loading…
Reference in a new issue