提交 63679112 编写于 作者: D David S. Miller

net: Zero terminate ifr_name in dev_ifname().

The ifr.ifr_name is passed around and assumed to be NULL terminated.
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 98de4e0e
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册