]> git.pld-linux.org Git - packages/coova-chilli.git/commitdiff
- better fix for buffer overflow problem (inspired by svn trunk)
authorpawelz <pawelz@pld-linux.org>
Thu, 30 Sep 2010 11:40:11 +0000 (11:40 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    strncpy.patch -> 1.1

strncpy.patch [new file with mode: 0644]

diff --git a/strncpy.patch b/strncpy.patch
new file mode 100644 (file)
index 0000000..a6921f6
--- /dev/null
@@ -0,0 +1,20 @@
+--- coova-chilli-1.2.4/src/chilli.c.orig       2010-08-24 13:29:08.000000000 +0200
++++ coova-chilli-1.2.4/src/chilli.c    2010-09-30 13:26:40.000000000 +0200
+@@ -966,8 +966,15 @@
+     strncpy(appconn->s_state.redir.username, mac, USERNAMESIZE);
+-    if (_options.macsuffix)
+-      strncat(appconn->s_state.redir.username, _options.macsuffix, USERNAMESIZE);
++    if (_options.macsuffix) {
++      size_t ulen = strlen(appconn->s_state.redir.username + ulen);
++      size_t size = USERNAMESIZE - ulen;
++
++      if (size) {
++        appconn->s_state.redir.username[--size + ulen] = '\0';
++        strncpy(appconn->s_state.redir.username + ulen, _options.macsuffix, size);
++      }
++    }
+   
+     username = appconn->s_state.redir.username;
+   } else {
This page took 0.078857 seconds and 4 git commands to generate.