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 <[email protected]>

Reply via email to