Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63679112 authored by David S. Miller's avatar David S. Miller
Browse files

net: Zero terminate ifr_name in dev_ifname().



The ifr.ifr_name is passed around and assumed to be NULL terminated.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 98de4e0e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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)