]> git.ipfire.org Git - thirdparty/openvpn.git/commit
sitnl: harden strncpy() by forcing arguments to have the same length
authorAntonio Quartulli <antonio@openvpn.net>
Mon, 5 Aug 2019 09:25:24 +0000 (11:25 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 15 Aug 2019 18:21:57 +0000 (20:21 +0200)
commit8a05f860af386cd135ee1aacb0d5eccc49c466bb
treee20241fc0aa1bc9fa00f971fec53814a7c83febd
parent26e5b80096a78ec7d5e7bcd15f81155be5fde2ec
sitnl: harden strncpy() by forcing arguments to have the same length

At the moment a strcpy() (without length check!) is performed between a
string long IFNAMSIZ bytes and one of 16 bytes. This is ok right now
because IFNAMSIZ is defined as 16, however this bit is not under our
control and may change in he future without us being warned.

For this reason, force both strings to use IFNAMSIZ as size and, since
this constant may not exist on every platform, ensure it is always
defined.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20190805092529.9467-2-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18722.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/networking_sitnl.c
src/openvpn/route.h