Sweep additional floors of strcpy in .get_drvinfo routines
Perform another round of floor sweeping, converting the .get_drvinfo routines of additional drivers from strcpy to strlcpy along with some conversion of sprintf to snprintf. Signed-off-by: Rick Jones <rick.jones2@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

orang tua
952c5ca14e
melakukan
23020ab353
@@ -1412,10 +1412,11 @@ static void amd8111e_get_drvinfo(struct net_device* dev, struct ethtool_drvinfo
|
||||
{
|
||||
struct amd8111e_priv *lp = netdev_priv(dev);
|
||||
struct pci_dev *pci_dev = lp->pci_dev;
|
||||
strcpy (info->driver, MODULE_NAME);
|
||||
strcpy (info->version, MODULE_VERS);
|
||||
sprintf(info->fw_version,"%u",chip_version);
|
||||
strcpy (info->bus_info, pci_name(pci_dev));
|
||||
strlcpy(info->driver, MODULE_NAME, sizeof(info->driver));
|
||||
strlcpy(info->version, MODULE_VERS, sizeof(info->version));
|
||||
snprintf(info->fw_version, sizeof(info->fw_version),
|
||||
"%u", chip_version);
|
||||
strlcpy(info->bus_info, pci_name(pci_dev), sizeof(info->bus_info));
|
||||
}
|
||||
|
||||
static int amd8111e_get_regs_len(struct net_device *dev)
|
||||
|
@@ -711,12 +711,14 @@ static void pcnet32_get_drvinfo(struct net_device *dev,
|
||||
{
|
||||
struct pcnet32_private *lp = netdev_priv(dev);
|
||||
|
||||
strcpy(info->driver, DRV_NAME);
|
||||
strcpy(info->version, DRV_VERSION);
|
||||
strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
|
||||
strlcpy(info->version, DRV_VERSION, sizeof(info->version));
|
||||
if (lp->pci_dev)
|
||||
strcpy(info->bus_info, pci_name(lp->pci_dev));
|
||||
strlcpy(info->bus_info, pci_name(lp->pci_dev),
|
||||
sizeof(info->bus_info));
|
||||
else
|
||||
sprintf(info->bus_info, "VLB 0x%lx", dev->base_addr);
|
||||
snprintf(info->bus_info, sizeof(info->bus_info),
|
||||
"VLB 0x%lx", dev->base_addr);
|
||||
}
|
||||
|
||||
static u32 pcnet32_get_link(struct net_device *dev)
|
||||
|
Reference in New Issue
Block a user