]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix commit a3160fc1bd7368395745b9cee6e40fb819f5564c
authorArne Schwabe <arne@rfc2549.org>
Wed, 14 Oct 2015 13:05:56 +0000 (15:05 +0200)
committerDavid Sommerseth <davids@redhat.com>
Thu, 15 Oct 2015 14:57:07 +0000 (16:57 +0200)
Move things to the proper place, ensure that line_ptr is actually properly
initialized for *every* line read, not just for the first one

Acked-by: Lev Stipakov <lstipakov@gmail.com>
Message-Id: 1444827956-2169-1-git-send-email-arne@rfc2549.org
URL: http://article.gmane.org/gmane.network.openvpn.devel/10271
Signed-off-by: David Sommerseth <davids@redhat.com>
(cherry picked from commit cba33989101175ac07434b9c5cceba116bf38127)

src/openvpn/options.c

index fc420bfffa3585a926741afedf1c5dffa2073777..5b6af827b39a19be4abb0ef4765df1ebb0e8d5f1 100644 (file)
@@ -3756,13 +3756,13 @@ 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)))
     {
+      char *line_ptr = line;
       /* Remove leading spaces */
       while (isspace(*line_ptr)) line_ptr++;
       if (!strncmp (line_ptr, close_tag, strlen (close_tag)))