]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Report missing endtags of inline files as warnings
authorArne Schwabe <arne@rfc2549.org>
Mon, 29 Jun 2015 12:46:35 +0000 (14:46 +0200)
committerGert Doering <gert@greenie.muc.de>
Tue, 30 Jun 2015 07:15:53 +0000 (09:15 +0200)
(2.3 reports as warning only, 2.4 reports as M_FATAL)

trac #568

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1435581995-11820-1-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/9830

Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 68eecf76978a80bd5d88e944e4ed5e42bf2fd8e4)

src/openvpn/options.c

index ff4b07b3907d2d84ab372d166f23c99806a1a300..98ddb69c978b91eec2198e63e243510abb64a77c 100644 (file)
@@ -3757,10 +3757,15 @@ read_inline_file (struct in_src *is, const char *close_tag, struct gc_arena *gc)
   char line[OPTION_LINE_SIZE];
   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)))
-       break;
+       {
+         endtagfound = true;
+         break;
+       }
       if (!buf_safe (&buf, strlen(line)))
        {
          /* Increase buffer size */
@@ -3772,6 +3777,8 @@ read_inline_file (struct in_src *is, const char *close_tag, struct gc_arena *gc)
        }
       buf_printf (&buf, "%s", line);
     }
+  if (!endtagfound)
+    msg (M_WARN, "WARNING: Endtag %s missing", close_tag);
   ret = string_alloc (BSTR (&buf), gc);
   buf_clear (&buf);
   free_buf (&buf);