Skip to content

Commit

Permalink
r8152: replace strncpy with strlcpy
Browse files Browse the repository at this point in the history
Replace the strncpy with strlcpy, and use sizeof to determine the
length.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
hayeswang authored and David S. Miller committed Aug 27, 2014
1 parent 5c21403 commit b0b46c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/usb/r8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -3151,8 +3151,8 @@ static void rtl8152_get_drvinfo(struct net_device *netdev,
{
struct r8152 *tp = netdev_priv(netdev);

strncpy(info->driver, MODULENAME, ETHTOOL_BUSINFO_LEN);
strncpy(info->version, DRIVER_VERSION, ETHTOOL_BUSINFO_LEN);
strlcpy(info->driver, MODULENAME, sizeof(info->driver));
strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
usb_make_path(tp->udev, info->bus_info, sizeof(info->bus_info));
}

Expand Down

0 comments on commit b0b46c7

Please sign in to comment.