Commit 27e09551 authored by roel kluin's avatar roel kluin Committed by David S. Miller

b44: strncpy does not null terminate string

strlcpy() will always null terminate the string. Also use the
sizeof(version) to strlcopy() the version string.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b902e573
......@@ -1756,15 +1756,15 @@ static void b44_get_drvinfo (struct net_device *dev, struct ethtool_drvinfo *inf
struct b44 *bp = netdev_priv(dev);
struct ssb_bus *bus = bp->sdev->bus;
strncpy(info->driver, DRV_MODULE_NAME, sizeof(info->driver));
strncpy(info->version, DRV_MODULE_VERSION, sizeof(info->driver));
strlcpy(info->driver, DRV_MODULE_NAME, sizeof(info->driver));
strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version));
switch (bus->bustype) {
case SSB_BUSTYPE_PCI:
strncpy(info->bus_info, pci_name(bus->host_pci), sizeof(info->bus_info));
strlcpy(info->bus_info, pci_name(bus->host_pci), sizeof(info->bus_info));
break;
case SSB_BUSTYPE_PCMCIA:
case SSB_BUSTYPE_SSB:
strncpy(info->bus_info, "SSB", sizeof(info->bus_info));
strlcpy(info->bus_info, "SSB", sizeof(info->bus_info));
break;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment