From: "cron2 (Code Review)" Date: Tue, 20 May 2025 12:10:17 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., heiko@...515..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <289259bd5e384c378734ec408339a9a46766314b-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="FvbXcS3+Tho="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: win: fix collecting DNS exclude data List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: d12fk , plaisthos , flichtenheld , stipa Cc: openvpn-devel --FvbXcS3+Tho= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#4) to the change originally created by= d12fk. ( http://gerrit.openvpn.net/c/openvpn/+/1028?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by stipa Change subject: win: fix collecting DNS exclude data ...................................................................... win: fix collecting DNS exclude data The size of the returned MULTI_SZ wide domains 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. DHCP assigned DNS server addresses are separated by space, not comma. These spaces were not replaced by semicolon, as the spec requires. Github: fixes OpenVPN/openvpn#747 Change-Id: Ie3fcd845344fd0c3ce9a2f99612fb19fe5ebb2f1 Signed-off-by: Heiko Hund Acked-by: Lev Stipakov Message-Id: <20250520085513.28213-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31= 727.html Signed-off-by: Gert Doering --- M src/openvpnserv/interactive.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/28/1028/4 diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index a1581a6..6681b7c 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; } @@ -2409,10 +2409,10 @@ if (v4_addrs_size || v6_addrs_size) { - /* Replace comma-delimters with semicolons, as required by NRP= T */ + /* Replace delimiters with semicolons, as required by NRPT */ for (int j =3D 0; j < sizeof(data[0].addresses) && data[i].add= resses[j]; j++) { - if (data[i].addresses[j] =3D=3D ',') + if (data[i].addresses[j] =3D=3D ',' || data[i].addresses[j= ] =3D=3D ' ') { data[i].addresses[j] =3D ';'; } -- 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: 4 Gerrit-Owner: d12fk Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-Reviewer: stipa Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --FvbXcS3+Tho= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #4 to the change originally cr= eated by d12fk.

View Change

The following approvals got outdated an= d were removed: Code-Review+2 by stipa

win: fix collecting DNS exclude data

The size= of the returned MULTI_SZ wide domains string was calculated
wrongly. In= stead of adding the size of a WCHAR, only the size of a char
was used. A= s a result, the domains string was stored too short and was
missing the = final string terminator.

DHCP assigned DNS server addresses are sepa= rated by space, not comma.
These spaces were not replaced by semicolon, = as the spec requires.

Github: fixes OpenVPN/openvpn#747
Change-Id= : Ie3fcd845344fd0c3ce9a2f99612fb19fe5ebb2f1
Signed-off-by: Heiko Hund &l= t;heiko@...2662...>
Acked-by: Lev Stipakov <lstipakov@...277...>= ;
Message-Id: <20250520085513.28213-1-gert@...1296...>
URL: htt= ps://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31727.html=
Signed-off-by: Gert Doering <gert@...1296...>
---
M src/ope= nvpnserv/interactive.c
1 file changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/28/10=
28/4
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/i=
nteractive.c
index a1581a6..6681b7c 100644
= --- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/i= nteractive.c
@@ -2226,7 +2226,7 @@
= {
/* This was the las= t 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_glyph);
= domains[buf_len - 1] =3D '\0';
= *pos =3D '.';
- *size +=3D 1;
+ *size +=3D one_glyph;

if (!comma)
= {
/* Conversion is done */
<= span> *(pos + domain_len) =3D '\0';

<= span style=3D"color: hsl(0, 100%, 40%);">- *size +=3D 1;=
+ = *size +=3D one_glyph;
return NO_ERROR= ;
}

@@ -= 2409,10 +2409,10 @@

if (v4_addrs= _size || v6_addrs_size)
{
- /* Replace comma-delimters with se= micolons, as required by NRPT */
+ /* Replace delimiters with semicolons, as required= by NRPT */
for (int j =3D 0; j < sizeof(da= ta[0].addresses) && data[i].addresses[j]; j++)
= {
- = if (data[i].addresses[j] =3D=3D ',')
+ if (data[i].addresses[j] =3D= =3D ',' || data[i].addresses[j] =3D=3D ' ')
{
data[i].addresses[= j] =3D ';';
}

To view, visit change 1028. To unsubscribe, or for help writing= mail filters, visit setting= s.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie3fcd845344fd0c3ce9a2f99612= fb19fe5ebb2f1
Gerrit-Change-Number: 1028
Gerrit-PatchSet: 4
Gerrit-Owner: d12fk <heiko@...515...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-Reviewer: stipa <lstipakov@...277...= >
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--FvbXcS3+Tho=--