aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Hershberger2019-07-30 14:49:56 -0500
committerJoe Hershberger2019-09-04 11:37:18 -0500
commit398e7512d8d7ea5aac8ba0a72c07a3810ce39f42 (patch)
tree34c0598931873d54442530c5068de02f112788b8
parent448f11f7503995746a7b71e5e3b3a831c4651be9 (diff)
net: Fix Covarity Defect 244093
Don't allow unterminated strings Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
-rw-r--r--net/mdio-uclass.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mdio-uclass.c b/net/mdio-uclass.c
index 36a404ff449..1c0d25272a3 100644
--- a/net/mdio-uclass.c
+++ b/net/mdio-uclass.c
@@ -75,7 +75,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);
+ strncpy(pdata->mii_bus->name, dev->name, MDIO_NAME_LEN - 1);
return mdio_register(pdata->mii_bus);
}