From: "cron2 (Code Review)" Date: Fri, 10 Oct 2025 14:30:53 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., marco@...2726..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <622391b73626451044207d1dfa4d25857773e77f-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="VwImgoeSC8k="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: PUSH_UPDATE server: bug-fix, reset buffer after processing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mrbff , plaisthos , flichtenheld Cc: openvpn-devel --VwImgoeSC8k= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#5) to the change originally created by= mrbff. ( http://gerrit.openvpn.net/c/openvpn/+/1264?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: PUSH_UPDATE server: bug-fix, reset buffer after processing ...................................................................... PUSH_UPDATE server: bug-fix, reset buffer after processing In the send_single_push_update() function the buffer containing the message was not reset after processing, so o in a push-update-broad the messages sent starting from the second client would have been shrunk (offset advanced and size decreased). Change-Id: I41d08a9a2e79ac1f1104e72dd5b7b7617e2071a0 Signed-off-by: Marco Baffo Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1264 Message-Id: <20251010142002.27308-1-gert@...1296...> URL: https://sourceforge.net/p/openvpn/mailman/message/59244933/ Signed-off-by: Gert Doering --- M src/openvpn/push_util.c 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/64/1264/5 diff --git a/src/openvpn/push_util.c b/src/openvpn/push_util.c index f306104..b475d2e 100644 --- a/src/openvpn/push_util.c +++ b/src/openvpn/push_util.c @@ -170,9 +170,12 @@ * inside `process_incoming_push_msg()`. However, we don't need * to check the return value here because we just want to `advance= `, * meaning we skip the `push_update_cmd' we added earlier. + * Also we need to make a temporary copy so we can buf_advance() + * without modifying original buffer. */ - buf_string_compare_advance(&msgs[i], push_update_cmd); - if (process_incoming_push_update(c, pull_permission_mask(c), optio= n_types_found, &msgs[i], true) =3D=3D PUSH_MSG_ERROR) + struct buffer tmp_msg =3D msgs[i]; + buf_string_compare_advance(&tmp_msg, push_update_cmd); + if (process_incoming_push_update(c, pull_permission_mask(c), optio= n_types_found, &tmp_msg, true) =3D=3D PUSH_MSG_ERROR) { msg(M_WARN, "Failed to process push update message sent to cli= ent ID: %u", c->c2.tls_multi ? c->c2.tls_multi->peer_id : UINT32_MAX); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1264?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I41d08a9a2e79ac1f1104e72dd5b7b7617e2071a0 Gerrit-Change-Number: 1264 Gerrit-PatchSet: 5 Gerrit-Owner: mrbff Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --VwImgoeSC8k= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #5 to the change originally created by mrbff.

<= p>View C= hange

The following approvals got outdated and were removed: Code-Review+2 by cron2

PUSH_UPDATE server: bug-fix, reset =
buffer after processing

In the send_single_push_update() function th= e buffer containing
the message was not reset after processing, so o in = a push-update-broad
the messages sent starting from the second client wo= uld have been
shrunk (offset advanced and size decreased).

Change= -Id: I41d08a9a2e79ac1f1104e72dd5b7b7617e2071a0
Signed-off-by: Marco Baff= o <marco@...2726...>
Acked-by: Gert Doering <gert@...1296...>= ;
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1264
Message-Id:= <20251010142002.27308-1-gert@...1296...>
URL: https://sourceforge= .net/p/openvpn/mailman/message/59244933/
Signed-off-by: Gert Doering <= ;gert@...1296...>
---
M src/openvpn/push_util.c
1 file changed,= 5 insertions(+), 2 deletions(-)

git pull ssh:=
//gerrit.openvpn.net:29418/openvpn refs/changes/64/1264/5
diff --=
git a/src/openvpn/push_util.c b/src/openvpn/push_util.c
ind= ex f306104..b475d2e 100644
--- a/src/openvpn/push_util.c
+++ b/src/openvpn/push_util.c
@@ -170,9 +170,= 12 @@
* inside `process_incoming_push_msg()`. How= ever, we don't need
* to check the return val= ue here because we just want to `advance`,
* mean= ing we skip the `push_update_cmd' we added earlier.
+ * Also we need to make a tempo= rary copy so we can buf_advance()
+ * without modifying original buffer.
*/

- = buf_string_compare_advance(&msgs[i], push_update_cmd);
- if (process_incoming_push_upda= te(c, pull_permission_mask(c), option_types_found, &msgs[i], true) =3D= =3D PUSH_MSG_ERROR)
+= struct buffer tmp_msg =3D msgs[i];
+ buf_string_compare_advance(&tmp_msg, pus= h_update_cmd);
+ = if (process_incoming_push_update(c, pull_permission_mask(c), option_type= s_found, &tmp_msg, true) =3D=3D PUSH_MSG_ERROR)
= {
msg(M_WARN, "Failed to process push u= pdate message sent to client ID: %u",
= c->c2.tls_multi ? c->c2.tls_multi->peer_id : UINT32_MAX);<= br>

To view, visit change 1264. To unsubscribe, or for= help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I41d08a9a2e79ac1f1104e72dd5b= 7b7617e2071a0
Gerrit-Change-Number: 1264
Gerrit-PatchSet: 5
Gerrit-Owner: mrbff <marco@...2726...> <= /div>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --VwImgoeSC8k=--