]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
tokenizer: input buffer was too small 0.7.5
authorVincent Bernat <bernat@luffy.cx>
Sat, 22 Jun 2013 11:57:31 +0000 (13:57 +0200)
committerVincent Bernat <bernat@luffy.cx>
Sat, 22 Jun 2013 11:57:58 +0000 (13:57 +0200)
NEWS
src/client/tokenizer.c

diff --git a/NEWS b/NEWS
index 2315b74c6bb5936271834d0615b6e3c14e9d6d95..8112330775cbc21278cdc7aceb2d8d4f45466dc1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+lldpd (0.7.5)
+  * Fixes:
+    + Segfault while tokenizing in lldpcli.
+
 lldpd (0.7.4)
   * Fixes:
     + Segfault in lldpcli.
index c1fd758c72e4f933e20813d23cac410fbc09a6d8..e751d72995b0b91cda50c8c65d22df1f618cec03 100644 (file)
@@ -41,8 +41,8 @@ tokenize_line(const char *line, int *argc, char ***argv)
        int escaped = 0;
        int ipos = 0;
        char quote = 0;
-       char input[2*strlen(line) + 2];
-       memset(input, 0, 2*strlen(line) + 4);
+       char input[2*strlen(line) + 3]; /* 3 = 2 for '\n ' and 1 for \0 */
+       memset(input, 0, 2*strlen(line) + 3);
        for (int pos = 0; line[pos]; pos++) {
                if (!escaped && strchr(escapes, line[pos]))
                        escaped = 1;