mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-02-10 11:42:58 +01:00
realtek: ethernet: Avoid usage of unsafe strcpy
strcpy doesn't check the length of the destination buffer. And strlcpy would not make sure to null-terminate the destination buffer. Even when it is clear that this string will fit in the currrent buffer, it is just best practice to avoid strcpy. Signed-off-by: Sven Eckelmann <sven@narfation.org> Link: https://github.com/openwrt/openwrt/pull/20906 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
parent
bc71e705aa
commit
80375e5acd
1 changed files with 2 additions and 1 deletions
|
|
@ -1798,7 +1798,8 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
|
|||
}
|
||||
pr_info("Using MAC %08x%08x\n", sw_r32(priv->r->mac),
|
||||
sw_r32(priv->r->mac + 4));
|
||||
strcpy(dev->name, "eth%d");
|
||||
strscpy(dev->name, "eth%d", sizeof(dev->name));
|
||||
|
||||
priv->pdev = pdev;
|
||||
priv->netdev = dev;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue