diff --git a/src/openvpn/common.h b/src/openvpn/common.h
index aa7b7217..e1096b98 100644
--- a/src/openvpn/common.h
+++ b/src/openvpn/common.h
@@ -67,7 +67,7 @@ typedef unsigned long ptr_type;
  * maximum size of a single TLS message (cleartext).
  * This parameter must be >= PUSH_BUNDLE_SIZE
  */
-#define TLS_CHANNEL_BUF_SIZE 2048
+#define TLS_CHANNEL_BUF_SIZE max_int(2048, USER_PASS_LEN)
 
 /* TLS control buffer minimum size
  *
diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c
index df72f15f..ea9bd8b0 100644
--- a/src/openvpn/manage.c
+++ b/src/openvpn/manage.c
@@ -2655,7 +2655,7 @@ man_connection_init(struct management *man)
          * Allocate helper objects for command line input and
          * command output from/to the socket.
          */
-        man->connection.in = command_line_new(1024);
+        man->connection.in = command_line_new(max_int(1024, USER_PASS_LEN));
         man->connection.out = buffer_list_new();
 
         /*
diff --git a/src/openvpn/options.h b/src/openvpn/options.h
index 3d8b5059..a46c0d7c 100644
--- a/src/openvpn/options.h
+++ b/src/openvpn/options.h
@@ -53,8 +53,8 @@
 /*
  * Max size of options line and parameter.
  */
-#define OPTION_PARM_SIZE 256
-#define OPTION_LINE_SIZE 256
+#define OPTION_PARM_SIZE max_int(256, USER_PASS_LEN)
+#define OPTION_LINE_SIZE max_int(256, USER_PASS_LEN)
 
 extern const char title_string[];
 
diff --git a/src/openvpn/options_parse.c b/src/openvpn/options_parse.c
index cb51ad24..1372a5fb 100644
--- a/src/openvpn/options_parse.c
+++ b/src/openvpn/options_parse.c
@@ -374,7 +374,7 @@ read_config_file(struct options *options, const char *file, int level, const cha
                 int offset = 0;
                 CLEAR(p);
                 ++line_num;
-                if (strlen(line) == OPTION_LINE_SIZE)
+                if ((int)strlen(line) == OPTION_LINE_SIZE)
                 {
                     msg(msglevel,
                         "In %s:%d: Maximum option line length (%d) exceeded, line starts with %s",
