Commit bf35c312 authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Ramon Fried
Browse files

net: mdio-uclass: rewrite dm_mdio_post_probe using strlcpy

dm_mdio_post_probe used to be vulnerable after truncation, but has been
patched by commit 398e7512

 ("net: Fix Covarity Defect 244093").
Nonetheless, we can use strlcpy like the rest of the code base now,
which yields the same result.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried's avatarRamon Fried <rfried.dev@gmail.com>
parent 977b53f0
......@@ -101,7 +101,7 @@ static int dm_mdio_post_probe(struct udevice *dev)
pdata->mii_bus->write = mdio_write;
pdata->mii_bus->reset = mdio_reset;
pdata->mii_bus->priv = dev;
strncpy(pdata->mii_bus->name, dev->name, MDIO_NAME_LEN - 1);
strlcpy(pdata->mii_bus->name, dev->name, MDIO_NAME_LEN);
return mdio_register(pdata->mii_bus);
}
......
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