From: "d12fk (Code Review)" Date: Tue, 20 May 2025 07:14:38 +0000 References: Reply-To: heiko@...515..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <771361fd8fc94dcef8b7366bfafca10b08c3321d-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="P5TaFNO2qcg="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: win: fix collecting DNS exclude domains List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --P5TaFNO2qcg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1028?usp=3Demail to review the following change. Change subject: win: fix collecting DNS exclude domains ...................................................................... win: fix collecting DNS exclude domains The size of the returned MULTI_SZ wide string was calculated wrongly. Instead of adding the size of a WCHAR, only the size of a char was used. As a result, the domains string was stored too short and was missing the final string terminator. Fixes: OpenVPN/openvpn#747 Change-Id: Ie3fcd845344fd0c3ce9a2f99612fb19fe5ebb2f1 Signed-off-by: Heiko Hund --- M src/openvpnserv/interactive.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/28/1028/1 diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index a1581a6..66afb7b 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -2226,7 +2226,7 @@ { /* This was the last domain */ *pos =3D '\0'; - *size +=3D 1; + *size +=3D one_glyph; return wcslen(domains) ? NO_ERROR : ERROR_FILE_NOT= _FOUND; } } @@ -2248,13 +2248,13 @@ memmove(pos + 1, pos, buf_size - converted_size - one_glyp= h); domains[buf_len - 1] =3D '\0'; *pos =3D '.'; - *size +=3D 1; + *size +=3D one_glyph; if (!comma) { /* Conversion is done */ *(pos + domain_len) =3D '\0'; - *size +=3D 1; + *size +=3D one_glyph; return NO_ERROR; } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1028?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ie3fcd845344fd0c3ce9a2f99612fb19fe5ebb2f1 Gerrit-Change-Number: 1028 Gerrit-PatchSet: 1 Gerrit-Owner: d12fk Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --P5TaFNO2qcg= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

d12fk would like plaisthos and flichtenheld to review t= his change.

V= iew Change

win: fix collecting DNS exclude domains

The size of t= he returned MULTI_SZ wide string was calculated wrongly.
Instead of addi= ng the size of a WCHAR, only the size of a char was used.
As a result, t= he domains string was stored too short and was missing the
final string = terminator.

Fixes: OpenVPN/openvpn#747
Change-Id: Ie3fcd845344fd0= c3ce9a2f99612fb19fe5ebb2f1
Signed-off-by: Heiko Hund <heiko@...2866...= .>
---
M src/openvpnserv/interactive.c
1 file changed, 3 insert= ions(+), 3 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/o=
penvpn refs/changes/28/1028/1
diff --git a/src/openvpnserv/interact=
ive.c b/src/openvpnserv/interactive.c
index a1581a6..66afb7= b 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -2226,7 +2226,7 @@=
{
= /* This was the last domain */
= *pos =3D '\0';
- *size +=3D 1;
+ *size +=3D one_glyph;<= br> return wcslen(domains) ? NO_ERROR : ERROR= _FILE_NOT_FOUND;
}
= }
@@ -2248,13 +2248,13 @@
= memmove(pos + 1, pos, buf_size - converted_size - one_glyph);=
domains[buf_len - 1] =3D '\0';
*pos =3D '.';
- *size +=3D 1;
+ *size +=3D one_gl= yph;


if (!comma)<= br> {
/* Convers= ion is done */
*(pos + domain_len) =3D= '\0';
- = *size +=3D 1;
+ *size +=3D one_glyph;
= return NO_ERROR;
}


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

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie3fcd845344fd0c3ce9a2f99612= fb19fe5ebb2f1
Gerrit-Change-Number: 1028
Gerrit-PatchSet: 1
Gerrit-Owner: d12fk <heiko@...515...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
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...>
Gerrit-MessageType: newchange
--P5TaFNO2qcg=--