diff --git a/lib/i3ipcpp b/lib/i3ipcpp index a6aa7a19..d4e4786b 160000 --- a/lib/i3ipcpp +++ b/lib/i3ipcpp @@ -1 +1 @@ -Subproject commit a6aa7a19786bdf7b96a02900510b3b3c325c8bdf +Subproject commit d4e4786be35b48d72dc7e59cf85ec34a90d129b5 diff --git a/src/adapters/net.cpp b/src/adapters/net.cpp index 97d3b818..5d122005 100644 --- a/src/adapters/net.cpp +++ b/src/adapters/net.cpp @@ -159,7 +159,12 @@ namespace net { driver.cmd = ETHTOOL_GDRVINFO; memset(&request, 0, sizeof(request)); - strncpy(request.ifr_name, m_interface.c_str(), IFNAMSIZ - 0); + + /* + * Only copy array size minus one bytes over to ensure there is a + * terminating NUL byte (which is guaranteed by memset) + */ + strncpy(request.ifr_name, m_interface.c_str(), IFNAMSIZ - 1); request.ifr_data = reinterpret_cast(&driver);