aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Engel <t-openbsc@tobias.org>2012-11-05 13:03:15 +0100
committerHarald Welte <laforge@gnumonks.org>2012-11-05 13:31:25 +0100
commit3d7500e68640f4914b358dee3dcbd2cba97b8679 (patch)
treedac9149b780e4199c0f753a5a0c0c736453cf156
parentf4594e236b07801f80121192df0ee1fa7958bc71 (diff)
Remove out-of-bounds write
This removes an out-of-bounds write. The whole statement can simply be removed since snprintf already adds the trailing 0 byte.
-rw-r--r--lib/tun.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/tun.c b/lib/tun.c
index f2fb14a..43a02ee 100644
--- a/lib/tun.c
+++ b/lib/tun.c
@@ -677,7 +677,6 @@ int tun_new(struct tun_t **tun)
/* Find suitable device */
for (devnum = 0; devnum < 255; devnum++) { /* TODO 255 */
snprintf(devname, sizeof(devname), "/dev/tun%d", devnum);
- devname[sizeof(devname)] = 0;
if (((*tun)->fd = open(devname, O_RDWR)) >= 0)
break;
if (errno != EBUSY)