summaryrefslogtreecommitdiffstats
path: root/src/openvpn/options.c
diff options
context:
space:
mode:
authorjanjust <janjust@nikhef.nl>2015-10-10 18:12:49 +0200
committerGert Doering <gert@greenie.muc.de>2015-10-11 09:52:13 +0200
commitc67acea173dc9ee37220f5b9ff14ede081181992 (patch)
treee1bb05d3a4385af0b1e83a0b2047b773ffafc0ca /src/openvpn/options.c
parent0c1d92291e4c1829bf503067e1f9d39328d01ee9 (diff)
downloadopenvpn-c67acea173dc9ee37220f5b9ff14ede081181992.tar.gz
openvpn-c67acea173dc9ee37220f5b9ff14ede081181992.tar.xz
openvpn-c67acea173dc9ee37220f5b9ff14ede081181992.zip
Fix "White space before end tags can break the config parser"
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>
Diffstat (limited to 'src/openvpn/options.c')
-rw-r--r--src/openvpn/options.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 7906f46..11e327c 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -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;