diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2011-01-06 09:29:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-10 02:44:08 -0500 |
commit | e0dc4f125456e57347a6d016bd7209f064135b1d (patch) | |
tree | 6458f1eaf49dabf7e08e65ec0493077cd84e260c /drivers/net/e1000e/netdev.c | |
parent | 482fed85e64958f678a138a4b5f8891190d2b169 (diff) |
e1000e: properly bounds-check string functions
Use string functions with bounds checking rather than their non-bounds
checking counterparts, and do not hard code these boundaries.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000e/netdev.c')
-rw-r--r-- | drivers/net/e1000e/netdev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 5498689ac20c..98729a6fb096 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -5639,7 +5639,7 @@ static void e1000_print_device_info(struct e1000_adapter *adapter) | |||
5639 | ret_val = e1000_read_pba_string_generic(hw, pba_str, | 5639 | ret_val = e1000_read_pba_string_generic(hw, pba_str, |
5640 | E1000_PBANUM_LENGTH); | 5640 | E1000_PBANUM_LENGTH); |
5641 | if (ret_val) | 5641 | if (ret_val) |
5642 | strcpy(pba_str, "Unknown"); | 5642 | strncpy((char *)pba_str, "Unknown", sizeof(pba_str) - 1); |
5643 | e_info("MAC: %d, PHY: %d, PBA No: %s\n", | 5643 | e_info("MAC: %d, PHY: %d, PBA No: %s\n", |
5644 | hw->mac.type, hw->phy.type, pba_str); | 5644 | hw->mac.type, hw->phy.type, pba_str); |
5645 | } | 5645 | } |
@@ -5968,7 +5968,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
5968 | if (!(adapter->flags & FLAG_HAS_AMT)) | 5968 | if (!(adapter->flags & FLAG_HAS_AMT)) |
5969 | e1000_get_hw_control(adapter); | 5969 | e1000_get_hw_control(adapter); |
5970 | 5970 | ||
5971 | strcpy(netdev->name, "eth%d"); | 5971 | strncpy(netdev->name, "eth%d", sizeof(netdev->name) - 1); |
5972 | err = register_netdev(netdev); | 5972 | err = register_netdev(netdev); |
5973 | if (err) | 5973 | if (err) |
5974 | goto err_register; | 5974 | goto err_register; |