]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix "White space before end tags can break the config parser"
authorjanjust <janjust@nikhef.nl>
Sat, 10 Oct 2015 16:12:49 +0000 (18:12 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 11 Oct 2015 07:52:13 +0000 (09:52 +0200)
trac #569

Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1444493569-24026-1-git-send-email-janjust@nikhef.nl>
URL: http://article.gmane.org/gmane.network.openvpn.devel/10249

Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/options.c

index 7906f46fd69cd9c2fb98d10e6602b1280a7cff69..11e327c1f45c794d0caafe468b1ecae65cd40a15 100644 (file)
@@ -3694,13 +3694,16 @@ static char *
 read_inline_file (struct in_src *is, const char *close_tag, struct gc_arena *gc)
 {
   char line[OPTION_LINE_SIZE];
+  char *line_ptr = line;
   struct buffer buf = alloc_buf (8*OPTION_LINE_SIZE);
   char *ret;
   bool endtagfound = false;
 
   while (in_src_get (is, line, sizeof (line)))
     {
-      if (!strncmp (line, close_tag, strlen (close_tag)))
+      /* Remove leading spaces */
+      while (isspace(*line_ptr)) line_ptr++;
+      if (!strncmp (line_ptr, close_tag, strlen (close_tag)))
        {
          endtagfound = true;
          break;