From: "cron2 (Code Review)" Date: Sun, 23 Nov 2025 13:28:44 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., heiko@...515..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="MHmgQt1Lqu0="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: iservice: make sure registry string is terminated List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: d12fk Cc: plaisthos , openvpn-devel --MHmgQt1Lqu0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/13= 92?usp=3Demail ) Change subject: iservice: make sure registry string is terminated ...................................................................... iservice: make sure registry string is terminated When reading the interface domains from the registry, check that the string is zero terminated, since the code in GetItfDnsDomains depends on the fact when doing size calculations during the conversion. Reported-by: Marc Heuse Reported-by: stephan@...2953... Change-Id: Icaeca22bdbd8ead0cb12345b1bcc2b5c0f46236f Signed-off-by: Heiko Hund Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1392 Message-Id: <20251123115851.19555-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34= 610.html Signed-off-by: Gert Doering --- M src/openvpnserv/interactive.c 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index d778e89..860375d 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -2163,7 +2163,7 @@ { *size =3D buf_size; err =3D RegGetValueW(itf, NULL, values[i], RRF_RT_REG_SZ, NULL, (P= BYTE)domains, size); - if (!err && *size > one_glyph && wcschr(domains, '.')) + if (!err && *size > one_glyph && domains[(*size / one_glyph) - 1] = =3D=3D '\0' && wcschr(domains, '.')) { /* * Found domain(s), now convert them: -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1392?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Icaeca22bdbd8ead0cb12345b1bcc2b5c0f46236f Gerrit-Change-Number: 1392 Gerrit-PatchSet: 2 Gerrit-Owner: d12fk Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --MHmgQt1Lqu0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

iservice: make sure registry string is terminate=
d

When reading the interface domains from the registry, check that t= he
string is zero terminated, since the code in GetItfDnsDomains depends=
on the fact when doing size calculations during the conversion.

= Reported-by: Marc Heuse <marc@...2953...>
Reported-by: stephan@...493...= 2953...
Change-Id: Icaeca22bdbd8ead0cb12345b1bcc2b5c0f46236f
Signed-o= ff-by: Heiko Hund <heiko@...2662...>
Acked-by: Gert Doering <ge= rt@...1296...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/139= 2
Message-Id: <20251123115851.19555-1-gert@...1296...>
URL: htt= ps://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34610.html=
Signed-off-by: Gert Doering <gert@...1296...>
---
M src/ope= nvpnserv/interactive.c
1 file changed, 1 insertion(+), 1 deletion(-)
=
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive=
.c
index d778e89..860375d 100644
--- a/src/= openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive= .c
@@ -2163,7 +2163,7 @@
{
<= span> *size =3D buf_size;
err =3D RegGetVa= lueW(itf, NULL, values[i], RRF_RT_REG_SZ, NULL, (PBYTE)domains, size);
- if (!err &&= ; *size > one_glyph && wcschr(domains, '.'))
<= span style=3D"color: hsl(120, 100%, 40%);">+ if (!err && *si= ze > one_glyph && domains[(*size / one_glyph) - 1] =3D=3D '\= 0' && wcschr(domains, '.'))

{<= /span>
/*
* Found domai= n(s), now convert them:

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

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Icaeca22bdbd8ead0cb12345b1bc= c2b5c0f46236f
Gerrit-Change-Number: 1392
Gerrit-PatchSet: 2
Gerrit-Owner: d12fk <heiko@...515...>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --MHmgQt1Lqu0=--