summaryrefslogtreecommitdiffstats
path: root/src/openvpn/options.c
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2015-07-27 17:33:11 +0200
committerGert Doering <gert@greenie.muc.de>2015-07-27 20:29:50 +0200
commit57576475f5d6e5dd9cdb64fa0edcf283ce4a05c9 (patch)
tree8a479d9520225695ff52fd29c4d71b1bf943e75d /src/openvpn/options.c
parent710bfb8aa99a591c14dfe033530a99289f943083 (diff)
downloadopenvpn-57576475f5d6e5dd9cdb64fa0edcf283ce4a05c9.tar.gz
openvpn-57576475f5d6e5dd9cdb64fa0edcf283ce4a05c9.tar.xz
openvpn-57576475f5d6e5dd9cdb64fa0edcf283ce4a05c9.zip
Fix commit e473b7c if an inline file happens to have a line break exactly at buffer limit
The check does only for strlen(line) space and buf_printf will only use at most space -1 and not print the final character ('\n') in this corner. Since a missing \n only breaks certificates at the start and end marker, missing line breaks otherwise do not trigger this error. Acked-by: Steffan Karger <steffan.karger@fox-it.com> Message-Id: <1438011191-19389-1-git-send-email-arne@rfc2549.org> URL: http://article.gmane.org/gmane.network.openvpn.devel/9956 Signed-off-by: Gert Doering <gert@greenie.muc.de> (cherry picked from commit d40cbf0e2601b35bfb1c0551c6f3907b5c5178ff)
Diffstat (limited to 'src/openvpn/options.c')
-rw-r--r--src/openvpn/options.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 99c0187..007bd8c 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -3766,7 +3766,7 @@ read_inline_file (struct in_src *is, const char *close_tag, struct gc_arena *gc)
endtagfound = true;
break;
}
- if (!buf_safe (&buf, strlen(line)))
+ if (!buf_safe (&buf, strlen(line)+1))
{
/* Increase buffer size */
struct buffer buf2 = alloc_buf (buf.capacity * 2);