summaryrefslogtreecommitdiff
path: root/src/linux
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2018-05-04 15:00:19 +0200
committerChristian Pointner <equinox@anytun.org>2018-06-08 18:23:56 +0200
commitfc91b7c8a770b21529635a85aa1c10889f074695 (patch)
tree14a2fe6a81903aeab23616b579401e6aac72f414 /src/linux
parentsource init-functions at initscript (diff)
fix off-by-one error in linux/tun.c
Diffstat (limited to 'src/linux')
-rw-r--r--src/linux/tun.c2
1 files changed, 1 insertions, 1 deletions
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);