From: "plaisthos (Code Review)" Date: Tue, 14 Oct 2025 11:33:58 +0000 References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <7337e2584def18d0e2039fc1410aa060a6ee1abf-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="8m+qQRRjN4Y="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Silence unhelpful compiler truncation warning with bigger buffer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: openvpn-devel --8m+qQRRjN4Y= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1272?usp=3Demail to review the following change. Change subject: Silence unhelpful compiler truncation warning with bigger b= uffer ...................................................................... Silence unhelpful compiler truncation warning with bigger buffer On the more recent mingw compilers (homebrew mingw 13.0.0, GCC 15.2.0) the compiler complains about a potential truncation in these two places. src/openvpn/tun.c:3806:57: error: '%s' directive output may be truncated writing up to 255 bytes into a region of size 178 [-Werror=3Dformat-truncation=3D] This not very helpful but just increasing the buffer sizes makes the warning go away. Change-Id: I54b11a5540fb236580a3b80c6d1e8678b24bd852 Signed-off-by: Arne Schwabe --- M src/openvpn/tun.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/72/1272/1 diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 06b7ae5..fc06b16 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -3784,7 +3784,7 @@ while (true) { char enum_name[256]; - char unit_string[256]; + char unit_string[512]; HKEY unit_key; char component_id_string[] =3D "ComponentId"; char component_id[256]; @@ -3895,7 +3895,7 @@ while (true) { char enum_name[256]; - char connection_string[256]; + char connection_string[512]; HKEY connection_key; WCHAR name_data[256]; DWORD name_type; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1272?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: I54b11a5540fb236580a3b80c6d1e8678b24bd852 Gerrit-Change-Number: 1272 Gerrit-PatchSet: 1 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: flichtenheld --8m+qQRRjN4Y= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: flichtenheld.

plaisthos would like flichtenheld to review this change.

V= iew Change

Silence unhelpful compiler truncation warni=
ng with bigger buffer

On the more recent mingw compilers (homebrew m= ingw 13.0.0, GCC 15.2.0) the
compiler complains about a potential trunca= tion in these two places.

src/openvpn/tun.c:3806:57:
error: &= #39;%s' directive output may be truncated writing up
to 255 bytes = into a region of size 178
[-Werror=3Dformat-truncation=3D]

This= not very helpful but just increasing the buffer sizes makes the warninggo away.

Change-Id: I54b11a5540fb236580a3b80c6d1e8678b24bd852
Si= gned-off-by: Arne Schwabe <arne@...1227...>
---
M src/openvpn/t= un.c
1 file changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/72/127=
2/1
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 06b7ae5..fc06b16 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -3784,7 +3784,7 @= @
while (true)
{
= char enum_name[256];
- char unit_string[256];
+ char unit_string[512];
= HKEY unit_key;
char component_id_string[] =3D &quo= t;ComponentId";
char component_id[256];
@@ -3895,7 +3895,7 @@
while (true) {
char enum_name[256];
- char connection_string[256];=

+ char connec= tion_string[512];
HKEY connection_key;
<= span> WCHAR name_data[256];

DWORD name_typ= e;

To view, visit change 1272. To unsubscri= be, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I54b11a5540fb236580a3b80c6d1= e8678b24bd852
Gerrit-Change-Number: 1272
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
= --8m+qQRRjN4Y=--