From: "flichtenheld (Code Review)" Date: Fri, 6 Mar 2026 11:56:43 +0000 In-Reply-To: References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, gert@...1296... Message-ID: <41ad8a0bb07211693e88bfe4c959a7be4d51186b-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="Sbipzt2oNIo="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: openvpnserv: Improve sanity check for addr_len in HandleWINSConfigMes... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --Sbipzt2oNIo= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello cron2, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1496?usp=3Demail to look at the new patch set (#6). The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied= now. Change subject: openvpnserv: Improve sanity check for addr_len in HandleWIN= SConfigMessage ...................................................................... openvpnserv: Improve sanity check for addr_len in HandleWINSConfigMessage Handle the case where the int is negative explicitly. Zero is probably a safer value to assume in this case. Change-Id: I03f4c640a2adbea9bbb6f6334f12375041ec429c Signed-off-by: Frank Lichtenheld --- M src/openvpnserv/interactive.c 1 file changed, 5 insertions(+), 10 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/96/1496/6 diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 227431a..09c709e 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -1247,11 +1247,6 @@ return err; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - /** * Check for a valid search list in a certain key of the registry * @@ -2944,7 +2939,11 @@ int addr_len =3D msg->addr_len; /* sanity check */ - if (addr_len > _countof(msg->addr)) + if (addr_len < 0) + { + addr_len =3D 0; + } + if ((unsigned int)addr_len > _countof(msg->addr)) { addr_len =3D _countof(msg->addr); } @@ -3005,10 +3004,6 @@ return err; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - static DWORD HandleEnableDHCPMessage(const enable_dhcp_message_t *dhcp) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1496?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: I03f4c640a2adbea9bbb6f6334f12375041ec429c Gerrit-Change-Number: 1496 Gerrit-PatchSet: 6 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld --Sbipzt2oNIo= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: flichtenheld, plaisthos.

flichtenheld uploaded patch set #6 to this change.

<= p>View C= hange

The change is no longer submittable: checks~ChecksSubmitRul= e is unsatisfied now.

openvpnserv: Improve sanity check fo=
r addr_len in HandleWINSConfigMessage

Handle the case where the int = is negative
explicitly. Zero is probably a safer value
to assume in t= his case.

Change-Id: I03f4c640a2adbea9bbb6f6334f12375041ec429c
Si= gned-off-by: Frank Lichtenheld <frank@...2641...>
---
M src/ope= nvpnserv/interactive.c
1 file changed, 5 insertions(+), 10 deletions(-)<= br>
git pull ssh://gerrit.openvpn.net:29418/openvpn =
refs/changes/96/1496/6
diff --git a/src/openvpnserv/interactive.c b=
/src/openvpnserv/interactive.c
index 227431a..09c709e 10064= 4
--- a/src/openvpnserv/interactive.c
+++ b= /src/openvpnserv/interactive.c
@@ -1247,11 +1247,6 @@
return err;
}

= -#if defined(__GNUC__) || defined= (__clang__)
-#pragma GC= C diagnostic push
-#pra= gma GCC diagnostic ignored "-Wsign-compare"
-#endif
-
/**
* Check for a vali= d search list in a certain key of the registry
*@@ -2944,7 +2939,11 @@
int addr_len =3D msg-&g= t;addr_len;

/* sanity check */
- if (addr_len > _coun= tof(msg->addr))
+ = if (addr_len < 0)
+ {
+ ad= dr_len =3D 0;
+ }<= /span>
+ if ((unsigned in= t)addr_len > _countof(msg->addr))
{
addr_len =3D _countof(msg->addr);

}
@@ -3005,10 +3004,6 @@
return err;
}

-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
static DWORD
Handl= eEnableDHCPMessage(const enable_dhcp_message_t *dhcp)
{

To view, visit change 1496. To unsubscribe, o= r for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I03f4c640a2adbea9bbb6f6334f1= 2375041ec429c
Gerrit-Change-Number: 1496
Gerrit-PatchSet: 6
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
= --Sbipzt2oNIo=--