From: janjust Date: Sat, 10 Oct 2015 16:12:49 +0000 (+0200) Subject: Fix "White space before end tags can break the config parser" X-Git-Tag: v2.3.9~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3160fc1bd7368395745b9cee6e40fb819f5564c;p=thirdparty%2Fopenvpn.git Fix "White space before end tags can break the config parser" trac #569 Acked-by: Arne Schwabe 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 (cherry picked from commit c67acea173dc9ee37220f5b9ff14ede081181992) --- diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 019ae6cb2..fc420bfff 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -3756,13 +3756,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;