From adde0c15b4dc38ed34cefbc854f8071cff7cc61d Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 4 May 2018 14:57:29 +0200 Subject: fix off-by-one error in tunDevice --- src/linux/tunDevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linux/tunDevice.cpp b/src/linux/tunDevice.cpp index e3f5bf4..97a7ede 100644 --- a/src/linux/tunDevice.cpp +++ b/src/linux/tunDevice.cpp @@ -79,7 +79,7 @@ TunDevice::TunDevice(std::string dev_name, std::string dev_type, std::string ifc } if(dev_name != "") { - strncpy(ifr.ifr_name, dev_name.c_str(), IFNAMSIZ); + strncpy(ifr.ifr_name, dev_name.c_str(), IFNAMSIZ-1); } fd_ = ::open(DEFAULT_DEVICE, O_RDWR); -- cgit v1.2.3