tun_new(): Fix array overflow in FreeBSD related code
Change-Id: I096e3b614e82e402886163274cfcf9355bd57580
This commit is contained in:
parent
ab6d189f8f
commit
81bc2aea53
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue