diff options
| author | Len Baker <[email protected]> | 2021-07-17 17:51:45 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2021-07-21 11:20:54 +0200 |
| commit | d2c57736c430a3fa2c5de2146642eb41f8fe6ca7 (patch) | |
| tree | a73c2f39120205b12bc5f9f8119b6861bc203e0e | |
| parent | 39630204a96aebdb29634b5f4aea6518e2b97eca (diff) | |
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: Len Baker <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
| -rw-r--r-- | drivers/staging/rtl8712/os_intfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c index 2214aca09730..9502f6aa5306 100644 --- a/drivers/staging/rtl8712/os_intfs.c +++ b/drivers/staging/rtl8712/os_intfs.c @@ -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); |