From: "d12fk (Code Review)" Date: Thu, 20 Nov 2025 17:55:54 +0000 In-Reply-To: References: Reply-To: heiko@...515..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="R6v1eSwhujw="; 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 --R6v1eSwhujw= 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 reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1387?usp=3Demail to look at the new patch set (#2). 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. While here, remove the unused FORMAT_MESSAGE_ARGUMENT_ARRAY flag. Just to make things a bit shorter. 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/2 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: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I4c3e5aed23d2e4c543066bb8032ad8808dcd27a8 Gerrit-Change-Number: 1387 Gerrit-PatchSet: 2 Gerrit-Owner: d12fk Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --R6v1eSwhujw= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

d12fk uploaded patch set #2 to this change.

View Change

iservice: fix buffer size in call to FormatMessage
<= br>The buffer size is to be given in # of TCHARs according to the docs. In<= br>this case that is the number of WCHARs in the buffer.

While here,= remove the unused FORMAT_MESSAGE_ARGUMENT_ARRAY flag. Just
to make thin= gs a bit shorter.

Reported-by: stephan@...2953...
Change-Id: I4c3= e5aed23d2e4c543066bb8032ad8808dcd27a8
Signed-off-by: Heiko Hund <heik= o@...2662...>
---
M src/openvpnserv/interactive.c
1 file change= d, 2 insertions(+), 3 deletions(-)

git pull ssh:=
//gerrit.openvpn.net:29418/openvpn refs/changes/87/1387/2
diff --=
git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c<=
br>index 33282c63..f64c247 100644
--- a/src/openvpnse= rv/interactive.c
+++ b/src/openvpnserv/interactive.c=
@@ -734,9 +734,8 @@

err_st= r =3D L"Unknown Win32 Error";

- if (FormatMessage(FORMAT_MESSAGE_IG= NORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM
- | FORMAT_MESSAGE_ARGUMENT_ARR= AY,
- = NULL, err, 0, buf, sizeof(buf), NULL))
+ if (FormatMessageW(FORMAT_MESSAGE_IGNORE_INSERTS= | FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL, err, 0, buf, _countof(buf), NULL))<= /span>
{
err_str =3D buf;
= }

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

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4c3e5aed23d2e4c543066bb8032= ad8808dcd27a8
Gerrit-Change-Number: 1387
Gerrit-PatchSet: 2
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...>
= --R6v1eSwhujw=--