From: "d12fk (Code Review)" Date: Thu, 20 Nov 2025 17:54:30 +0000 References: Reply-To: heiko@...515..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <18fd21d25ea9b4bf510104424ab49bf2925056ce-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="f5tTdzPBJV8="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: iservice: fix buffer size in call to FormatMessage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --f5tTdzPBJV8= 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/+/1387?usp=3Demail to review the following change. Change subject: iservice: fix buffer size in call to FormatMessage ...................................................................... iservice: fix buffer size in call to FormatMessage The buffer size is to be given in # of TCHARs according to the docs. In this case that is the number of WCHARs in the buffer. Reported-by: stephan@...2953... Change-Id: I4c3e5aed23d2e4c543066bb8032ad8808dcd27a8 Signed-off-by: Heiko Hund --- M src/openvpnserv/interactive.c 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/87/1387/1 diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 33282c63..f64c247 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -734,9 +734,8 @@ err_str =3D L"Unknown Win32 Error"; - if (FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_= SYSTEM - | FORMAT_MESSAGE_ARGUMENT_ARRAY, - NULL, err, 0, buf, sizeof(buf), NULL)) + if (FormatMessageW(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM= _SYSTEM, + NULL, err, 0, buf, _countof(buf), NULL)) { err_str =3D buf; } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1387?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: I4c3e5aed23d2e4c543066bb8032ad8808dcd27a8 Gerrit-Change-Number: 1387 Gerrit-PatchSet: 1 Gerrit-Owner: d12fk Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --f5tTdzPBJV8= 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: fix buffer size in call to Format=
Message

The buffer size is to be given in # of TCHARs according to t= he docs. In
this case that is the number of WCHARs in the buffer.
Reported-by: stephan@...2953...
Change-Id: I4c3e5aed23d2e4c543066bb8032= ad8808dcd27a8
Signed-off-by: Heiko Hund <heiko@...2662...>
---<= br>M src/openvpnserv/interactive.c
1 file changed, 2 insertions(+), 3 de= letions(-)

git pull ssh://gerrit.openvpn.net:294=
18/openvpn refs/changes/87/1387/1
diff --git a/src/openvpnserv/inte=
ractive.c b/src/openvpnserv/interactive.c
index 33282c63..f= 64c247 100644
--- a/src/openvpnserv/interactive.c+++ b/src/openvpnserv/interactive.c
@@ -734,9 +734,8= @@

err_str =3D L"Unknown Win32= Error";

- if (FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESS= AGE_FROM_SYSTEM
- = | FORMAT_MESSAGE_ARGUMENT_ARRAY,
- NULL, err, 0, buf, si= zeof(buf), NULL))
+ = if (FormatMessageW(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SY= STEM,
+ = NULL, err, 0, buf, _countof(buf), NULL))
{
err_str =3D buf;
}

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

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4c3e5aed23d2e4c543066bb8032= ad8808dcd27a8
Gerrit-Change-Number: 1387
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...>
= --f5tTdzPBJV8=--