Skip to content

Commit

Permalink
net: Zero terminate ifr_name in dev_ifname().
Browse files Browse the repository at this point in the history
The ifr.ifr_name is passed around and assumed to be NULL terminated.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed Jul 19, 2017
1 parent 98de4e0 commit 6367911
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/core/dev_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ static int dev_ifname(struct net *net, struct ifreq __user *arg)

if (copy_from_user(&ifr, arg, sizeof(struct ifreq)))
return -EFAULT;
ifr.ifr_name[IFNAMSIZ-1] = 0;

error = netdev_get_name(net, ifr.ifr_name, ifr.ifr_ifindex);
if (error)
Expand Down

0 comments on commit 6367911

Please sign in to comment.