summaryrefslogtreecommitdiffstats
path: root/src/openvpn/options.c
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2015-06-29 14:46:35 +0200
committerGert Doering <gert@greenie.muc.de>2015-06-30 09:13:18 +0200
commit68eecf76978a80bd5d88e944e4ed5e42bf2fd8e4 (patch)
tree9163d5fb23638def43327b3d01c7aa599ee1af1f /src/openvpn/options.c
parente5f71d674e3b119d6a252d7cef1c17b5c2b36a9a (diff)
downloadopenvpn-68eecf76978a80bd5d88e944e4ed5e42bf2fd8e4.tar.gz
openvpn-68eecf76978a80bd5d88e944e4ed5e42bf2fd8e4.tar.xz
openvpn-68eecf76978a80bd5d88e944e4ed5e42bf2fd8e4.zip
Report missing end-tags of inline files as errors
(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>
Diffstat (limited to 'src/openvpn/options.c')
-rw-r--r--src/openvpn/options.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 74276d4..4165ec7 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -3703,10 +3703,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 */
@@ -3718,6 +3723,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_FATAL, "ERROR: Endtag %s missing", close_tag);
ret = string_alloc (BSTR (&buf), gc);
buf_clear (&buf);
free_buf (&buf);