[MERGED] 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 11:33:54 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: tun_new(): Fix array overflow in FreeBSD related code
......................................................................


tun_new(): Fix array overflow in FreeBSD related code

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

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/lib/tun.c b/lib/tun.c
index f6869ef..c4b7d10 100644
--- a/lib/tun.c
+++ b/lib/tun.c
@@ -784,7 +784,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: merged
Gerrit-Change-Id: I096e3b614e82e402886163274cfcf9355bd57580
Gerrit-PatchSet: 2
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list