From fc91b7c8a770b21529635a85aa1c10889f074695 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 4 May 2018 15:00:19 +0200 Subject: fix off-by-one error in linux/tun.c --- src/linux/tun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/linux') diff --git a/src/linux/tun.c b/src/linux/tun.c index c77cea1..fccea9c 100644 --- a/src/linux/tun.c +++ b/src/linux/tun.c @@ -103,7 +103,7 @@ int tun_init(tun_device_t* dev, const char* dev_name, const char* dev_type, cons } if(dev_name) - strncpy(ifr.ifr_name, dev_name, IFNAMSIZ); + strncpy(ifr.ifr_name, dev_name, IFNAMSIZ-1); if(!ioctl(dev->fd_, TUNSETIFF, &ifr)) { dev->actual_name_ = strdup(ifr.ifr_name); -- cgit v1.2.3