Browse Source

net: ethernet: ti: cpmac.c: Cleaning up missing null-terminate after strncpy call

Added a guaranteed null-terminate after call to strncpy.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
Rickard Strandqvist 11 years ago
parent
commit
9951e04849
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/net/ethernet/ti/cpmac.c

+ 1 - 0
drivers/net/ethernet/ti/cpmac.c

@@ -1130,6 +1130,7 @@ static int cpmac_probe(struct platform_device *pdev)
 		strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */
 		strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */
 		phy_id = pdev->id;
 		phy_id = pdev->id;
 	}
 	}
+	mdio_bus_id[sizeof(mdio_bus_id) - 1] = '\0';
 
 
 	dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES);
 	dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES);
 	if (!dev)
 	if (!dev)