summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2018-05-04 14:57:29 +0200
committerChristian Pointner <equinox@anytun.org>2018-05-04 14:57:29 +0200
commitadde0c15b4dc38ed34cefbc854f8071cff7cc61d (patch)
treebe72570422edf74ea1aff15ace1c241f1e1d4625
parentupdated changelog for release (diff)
fix off-by-one error in tunDevice
-rw-r--r--src/linux/tunDevice.cpp2
1 files changed, 1 insertions, 1 deletions
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);