From: "d12fk (Code Review)" Date: Sun, 23 Nov 2025 06:47:29 +0000 References: Reply-To: heiko@...515..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <43b86d378bf4c1f48861af4f0cc6c8840ebed761-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="VGvyB5we6EM="; 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: plaisthos Cc: openvpn-devel --VGvyB5we6EM= 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/+/1392?usp=3Demail to review the following change. 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 --- M src/openvpnserv/interactive.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/92/1392/1 diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index f31a8a9..ec80a30 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: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Icaeca22bdbd8ead0cb12345b1bcc2b5c0f46236f Gerrit-Change-Number: 1392 Gerrit-PatchSet: 1 Gerrit-Owner: d12fk Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --VGvyB5we6EM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

d12fk would like plaisthos to review this change.

V= iew Change

iservice: make sure registry string is term=
inated

When reading the interface domains from the registry, check t= hat the
string is zero terminated, since the code in GetItfDnsDomains de= pends
on the fact when doing size calculations during the conversion.
Reported-by: Marc Heuse <marc@...2953...>
Reported-by: stepha= n@...2953...
Change-Id: Icaeca22bdbd8ead0cb12345b1bcc2b5c0f46236f
Sig= ned-off-by: Heiko Hund <heiko@...2662...>
---
M src/openvpnserv= /interactive.c
1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/change=
s/92/1392/1
diff --git a/src/openvpnserv/interactive.c b/src/openvp=
nserv/interactive.c
index f31a8a9..ec80a30 100644--- a/src/openvpnserv/interactive.c
+++ b/src/openvp= nserv/interactive.c
@@ -2163,7 +2163,7 @@
= {
*size =3D buf_size;
= err =3D RegGetValueW(itf, NULL, values[i], RRF_RT_REG_SZ, NULL, (PBYTE)dom= ains, size);
- i= f (!err && *size > one_glyph && wcschr(domains, '.&#= 39;))
+ if (!e= rr && *size > one_glyph && domains[(*size / one_glyph) -= 1] =3D=3D '\0' && wcschr(domains, '.'))
= {
/*
= * Found domain(s), now convert them:

<= p>To view, visit change 1392. To unsubscribe, or for help writing mail filters= , visit settings= .

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Icaeca22bdbd8ead0cb12345b1bc= c2b5c0f46236f
Gerrit-Change-Number: 1392
Gerrit-PatchSet: 1
Gerrit-Owner: d12fk <heiko@...515...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --VGvyB5we6EM=--