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 <lafo...@gnumonks.org>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder

Reply via email to