Skip to contentSkip to conversation

Fix trac ticket #569

PATCH In review [email protected]... 3 participants 3 messages Oct 10, 2015 – Oct 11, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix trac ticket #569

From: janjust <[email protected]...>

Fix trac ticket #569 "White space before end tags can break the config parser"
https://community.openvpn.net/openvpn/ticket/569

---
 src/openvpn/options.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
src/openvpn/options.c +4 -1
index 7906f46..11e327c 100644
@@ -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;
Signature · 1 line
1.7.1
#2 lore raw
In reply to [email protected]...

Your patch has been applied to the master and release/2.3 branch.

commit c67acea173dc9ee37220f5b9ff14ede081181992 (master) commit a3160fc1bd7368395745b9cee6e40fb819f5564c (release/2.3)

Author: janjust <[email protected]...>
Date:   Sat Oct 10 18:12:49 2015 +0200
    Fix "White space before end tags can break the config parser"
    
    trac #569
    
    Acked-by: Arne Schwabe <[email protected]...>
    Message-Id: <[email protected]...>
    URL: http://article.gmane.org/gmane.network.openvpn.devel/10249
    
    Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering