Use strlcpy() instead of strncpy() when copying ifname to ensure
that it is NUL terminated. Additional NUL padding is not required for short names. Reported by: Coverity CID: 974852 MFC after: 1 week
This commit is contained in:
parent
1ef3d54d20
commit
7b06334915
@ -222,7 +222,7 @@ call_driver(unsigned long cmd, struct iohdr *iohdr)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
strncpy(iohdr->ifname, ifname, sizeof(iohdr->ifname));
|
||||
strlcpy(iohdr->ifname, ifname, sizeof(iohdr->ifname));
|
||||
iohdr->cookie = NGM_LMC_COOKIE;
|
||||
iohdr->iohdr = iohdr;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user