From: "stipa (Code Review)" Date: Mon, 11 Sep 2023 12:42:23 +0000 References: Reply-To: lstipakov@...277..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <37df9e97b8e8ea8db6f576e861e934f4252899a2-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="zpLV6Cfvmtc="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[release/2.6]: Warn user if INFO control command is too long List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: openvpn-devel --zpLV6Cfvmtc= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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/+/329?usp=3Demail to review the following change. Change subject: Warn user if INFO control command is too long ...................................................................... Warn user if INFO control command is too long "INFO_PRE,..." command length is limited to 256 bytes. If the server implementation pushes command which is too long, warn the user and don't send the truncated command to a management client. Change-Id: If3c27a2a2ba24f2af0e3e3c95eea57ed420b2542 Signed-off-by: Lev Stipakov --- M src/openvpn/push.c 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/29/329/1 diff --git a/src/openvpn/push.c b/src/openvpn/push.c index d468211..19849c5 100644 --- a/src/openvpn/push.c +++ b/src/openvpn/push.c @@ -244,8 +244,14 @@ * for management greeting and we don't want to confuse the client */ struct buffer out =3D alloc_buf_gc(256, &gc); - buf_printf(&out, ">%s:%s", "INFOMSG", m); - management_notify_generic(management, BSTR(&out)); + if (buf_printf(&out, ">%s:%s", "INFOMSG", m)) + { + management_notify_generic(management, BSTR(&out)); + } + else + { + msg(D_PUSH_ERRORS, "WARNING: Received INFO command is too long= , won't notify management client."); + } gc_free(&gc); } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/329?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: release/2.6 Gerrit-Change-Id: If3c27a2a2ba24f2af0e3e3c95eea57ed420b2542 Gerrit-Change-Number: 329 Gerrit-PatchSet: 1 Gerrit-Owner: stipa Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --zpLV6Cfvmtc= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld.

stipa would like flichtenheld to review this change.

Vi= ew Change

Warn user if INFO control command is too long

"IN= FO_PRE,..." command length is limited to 256 bytes. If the server
i= mplementation pushes command which is too long, warn the user and
don= 9;t send the truncated command to a management client.

Change-Id: If= 3c27a2a2ba24f2af0e3e3c95eea57ed420b2542
Signed-off-by: Lev Stipakov <= lev@...515...>
---
M src/openvpn/push.c
1 file changed, 8 inser= tions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/=
openvpn refs/changes/29/329/1
diff --git a/src/openvpn/push.c b/src=
/openvpn/push.c
index d468211..19849c5 100644
--- a/src/openvpn/push.c
+++ b/src/openvpn/push.c=
@@ -244,8 +244,14 @@
* for management g= reeting and we don't want to confuse the client
= */
struct buffer out =3D alloc_buf_gc(256, &= ;gc);
- buf_prin= tf(&out, ">%s:%s", "INFOMSG", m);
- management_notify_generic(ma= nagement, BSTR(&out));
+ if (buf_printf(&out, ">%s:%s", "INFOMS= G", m))
+ = {
+ manag= ement_notify_generic(management, BSTR(&out));
+ }
+ else
+ {
+ }

gc_free(&gc);
}

To view, visit change 329. To unsubscribe, or for help writing mai= l filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: If3c27a2a2ba24f2af0e3e3c95ee= a57ed420b2542
Gerrit-Change-Number: 329
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <lstipakov@...277...>= ;
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newchange
--zpLV6Cfvmtc=--