[Openvpn-devel,XS] Change in openvpn[release/2.6]: Support for long INFO/INFO_PRE messages

Message ID a8e62f9022afe4ed26441e86b08bcc06289ca828-HTML@gerrit.openvpn.net
State Superseded
Headers show
Series [Openvpn-devel,XS] Change in openvpn[release/2.6]: Support for long INFO/INFO_PRE messages | expand

Commit Message

flichtenheld (Code Review) Sept. 4, 2023, 2:22 p.m. UTC
Attention is currently required from: flichtenheld.

Hello flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/327?usp=email

to review the following change.


Change subject: Support for long INFO/INFO_PRE messages
......................................................................

Support for long INFO/INFO_PRE messages

Current hardcoded limit is not defined anywhere and
the server (CloudConnexa) sends the longer string in some cases.

Change-Id: I2139b62117ba69d643b585d2610e8aef15f71d3e
Signed-off-by: Lev Stipakov <lev@openvpn.net>
---
M src/openvpn/push.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/27/327/1

Patch

diff --git a/src/openvpn/push.c b/src/openvpn/push.c
index d468211..663cfbd 100644
--- a/src/openvpn/push.c
+++ b/src/openvpn/push.c
@@ -243,7 +243,7 @@ 
          * We use >INFOMSG here instead of plain >INFO since INFO is used to
          * for management greeting and we don't want to confuse the client
          */
-        struct buffer out = alloc_buf_gc(256, &gc);
+        struct buffer out = alloc_buf_gc(1 + 7 + 1 + BLEN(&buf) + 1, &gc);
         buf_printf(&out, ">%s:%s", "INFOMSG", m);
         management_notify_generic(management, BSTR(&out));