diff options
author | Len Baker <len.baker@gmx.com> | 2021-08-01 19:12:26 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-08-03 11:48:28 +0100 |
commit | 493c3ca6bd754d8587604496eb814f72e933075d (patch) | |
tree | 370ce9459825c597ebb1b30b6ef0c2864c1e784d /drivers/net/usb/ipheth.c | |
parent | 9c638eaf42ec8d62ed028feb7a5b7f2759087971 (diff) | |
download | lwn-493c3ca6bd754d8587604496eb814f72e933075d.tar.gz lwn-493c3ca6bd754d8587604496eb814f72e933075d.zip |
drivers/net/usb: Remove all strcpy() uses
strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy().
Signed-off-by: Len Baker <len.baker@gmx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/ipheth.c')
-rw-r--r-- | drivers/net/usb/ipheth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c index 207e59e74935..06e2181e5810 100644 --- a/drivers/net/usb/ipheth.c +++ b/drivers/net/usb/ipheth.c @@ -443,7 +443,7 @@ static int ipheth_probe(struct usb_interface *intf, netdev->netdev_ops = &ipheth_netdev_ops; netdev->watchdog_timeo = IPHETH_TX_TIMEOUT; - strcpy(netdev->name, "eth%d"); + strscpy(netdev->name, "eth%d", sizeof(netdev->name)); dev = netdev_priv(netdev); dev->udev = udev; |