Commit d2c57736 authored by Len Baker's avatar Len Baker Committed by Greg Kroah-Hartman

staging/rtl8712: Remove all strcpy() uses in favor of strscpy()

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: default avatarLen Baker <len.baker@gmx.com>
Link: https://lore.kernel.org/r/20210717155145.15041-1-len.baker@gmx.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 39630204
......@@ -203,7 +203,7 @@ struct net_device *r8712_init_netdev(void)
if (!pnetdev)
return NULL;
if (dev_alloc_name(pnetdev, ifname) < 0) {
strcpy(ifname, "wlan%d");
strscpy(ifname, "wlan%d", sizeof(ifname));
dev_alloc_name(pnetdev, ifname);
}
padapter = netdev_priv(pnetdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment