]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
mash LF to NUL, so that we can parse lines individually
authorAlan T. DeKok <aland@freeradius.org>
Wed, 27 Sep 2017 15:29:08 +0000 (11:29 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 27 Sep 2017 16:25:25 +0000 (12:25 -0400)
src/modules/proto_detail/proto_detail_file.c

index 192237a0b1e4e99cbd4c3a50eb937e859e920a64..dd2b1460c8214a5ab2daaf80a154812a20edcbb5 100644 (file)
@@ -208,6 +208,8 @@ redo:
                }
 
                if (p[1] == '\n') {
+                       p[0] = '\0';
+                       p[1] = '\0';
                        next = p + 2;
                        stopped_search = next;
                        break;
@@ -223,6 +225,12 @@ redo:
                        return -1;
                }
 
+               /*
+                *      Smash the \n with zero, so that each line can
+                *      be parsed individually.
+                */
+               p[0] = '\0';
+
                /*
                 *      Skip the \n\t
                 */