From 0eb5a34cdf34ad07b6db2df1e523aaf6574601b4 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Wed, 27 Sep 2006 12:53:17 -0700 Subject: e100, e1000, ixgb: Fix an impossible memory overwrite bug We keep getting requests from people that think that this might be an exploitable hole where we would overwrite 4 bytes in the netdev struct if the pci name would exceed 15 characters. In reality this will never happen but we fix it anyway. Signed-off-by: Auke Kok --- drivers/net/e100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/e100.c') diff --git a/drivers/net/e100.c b/drivers/net/e100.c index d9750e269a56..ab0868cb120c 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c @@ -2572,7 +2572,7 @@ static int __devinit e100_probe(struct pci_dev *pdev, #ifdef CONFIG_NET_POLL_CONTROLLER netdev->poll_controller = e100_netpoll; #endif - strcpy(netdev->name, pci_name(pdev)); + strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); nic = netdev_priv(netdev); nic->netdev = netdev; -- cgit v1.2.3