diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-08-11 12:56:30 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-08-11 13:12:09 +0200 |
commit | 81bc2aea53a6dbca8b1b3f32a042afb3db5640d1 (patch) | |
tree | b387be8e057cc41ac7b646847ce0f1f0a91185e2 /lib/tun.c | |
parent | ab6d189f8f2fa7531d22636e1ac8c149c801d2e3 (diff) |
tun_new(): Fix array overflow in FreeBSD related code
Change-Id: I096e3b614e82e402886163274cfcf9355bd57580
Diffstat (limited to 'lib/tun.c')
-rw-r--r-- | lib/tun.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -784,7 +784,7 @@ int tun_new(struct tun_t **tun) } snprintf((*tun)->devname, sizeof((*tun)->devname), "tun%d", devnum); - (*tun)->devname[sizeof((*tun)->devname)] = 0; + (*tun)->devname[sizeof((*tun)->devname)-1] = 0; /* The tun device we found might have "old" IP addresses allocated */ /* We need to delete those. This problem is not present on Linux */ |