From: "flichtenheld (Code Review)" Date: Fri, 30 Jan 2026 16:11:06 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="07+/HGkEfPA="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: push: Improve check of vsnprintf return value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --07+/HGkEfPA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1502?usp=3Demail to review the following change. Change subject: push: Improve check of vsnprintf return value ...................................................................... push: Improve check of vsnprintf return value Avoid sign-compare warning and do not ignore error return values. Change-Id: I7be033bc88e9a6ba474916c8be039c126e8bc574 Signed-off-by: Frank Lichtenheld --- M src/openvpn/push.c 1 file changed, 1 insertion(+), 10 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/02/1502/1 diff --git a/src/openvpn/push.c b/src/openvpn/push.c index d13b24a..a948973 100644 --- a/src/openvpn/push.c +++ b/src/openvpn/push.c @@ -800,11 +800,6 @@ gc_free(&gc); } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - bool send_push_reply(struct context *c, struct push_list *per_client_push_list) { @@ -936,7 +931,7 @@ va_start(arglist, format); len =3D vsnprintf(tmp, sizeof(tmp), format, arglist); va_end(arglist); - if (len > sizeof(tmp) - 1) + if (len < 0 || len >=3D (int)sizeof(tmp)) { return false; } @@ -944,10 +939,6 @@ return true; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - void push_reset(struct options *o) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1502?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I7be033bc88e9a6ba474916c8be039c126e8bc574 Gerrit-Change-Number: 1502 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --07+/HGkEfPA= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

push: Improve check of vsnprintf return val=
ue

Avoid sign-compare warning and do not ignore error
return valu= es.

Change-Id: I7be033bc88e9a6ba474916c8be039c126e8bc574
Signed-o= ff-by: Frank Lichtenheld <frank@...2641...>
---
M src/openvpn/p= ush.c
1 file changed, 1 insertion(+), 10 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/02/15=
02/1
diff --git a/src/openvpn/push.c b/src/openvpn/push.cindex d13b24a..a948973 100644
--- a/src/openvpn/push= .c
+++ b/src/openvpn/push.c
@@ -800,11 +800= ,6 @@
gc_free(&gc);
}
<= span>
-#if defined(__G= NUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-compare"
-#endif
-
bool
s= end_push_reply(struct context *c, struct push_list *per_client_push_list)
{
@@ -936,7 +931,7 @@
= va_start(arglist, format);
len =3D vsnprintf(tmp, size= of(tmp), format, arglist);
va_end(arglist);
= - if (len > sizeof(tmp) - 1= )
+ if (len < 0= || len >=3D (int)sizeof(tmp))
{
= return false;
}
@@ -944,10 +939= ,6 @@
return true;
}
=
-#if defined(__GNUC__= ) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-<= br> void
push_reset(struct options *o)
{


To view, visit change 1502. To unsubs= cribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I7be033bc88e9a6ba474916c8be0= 39c126e8bc574
Gerrit-Change-Number: 1502
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --07+/HGkEfPA=--