[PATCH] openggsn[master]: tun_new(): Fix array overflow in FreeBSD related code

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Aug 11 10:57:24 UTC 2017


Review at  https://gerrit.osmocom.org/3472

tun_new(): Fix array overflow in FreeBSD related code

Change-Id: I096e3b614e82e402886163274cfcf9355bd57580
---
M lib/tun.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/72/3472/1

diff --git a/lib/tun.c b/lib/tun.c
index 717da88..767052f 100644
--- a/lib/tun.c
+++ b/lib/tun.c
@@ -786,7 +786,7 @@
 	}
 
 	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 */

-- 
To view, visit https://gerrit.osmocom.org/3472
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I096e3b614e82e402886163274cfcf9355bd57580
Gerrit-PatchSet: 1
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list