From: "cron2 (Code Review)" Date: Sat, 24 Jan 2026 13:34:56 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <2ab28e961b7935ca580fad2cc3811c904898b51a-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="tOlpDJGx718="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: ssl_ncp: Avoid conversion warning in replace_default_in_ncp_ciphers_o... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --tOlpDJGx718= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1452?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by plaisthos Change subject: ssl_ncp: Avoid conversion warning in replace_default_in_ncp= _ciphers_option ...................................................................... ssl_ncp: Avoid conversion warning in replace_default_in_ncp_ciphers_option Change-Id: I380e842b7429060d13bc0264e55fa5c06ab427df Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1452 Message-Id: <20260122125829.108470-1-frank@...2641...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 391.html Signed-off-by: Gert Doering --- M src/openvpn/ssl_ncp.c 1 file changed, 3 insertions(+), 11 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/52/1452/2 diff --git a/src/openvpn/ssl_ncp.c b/src/openvpn/ssl_ncp.c index 1a2405c..20fd2f0 100644 --- a/src/openvpn/ssl_ncp.c +++ b/src/openvpn/ssl_ncp.c @@ -534,11 +534,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - /** * Replaces the string DEFAULT with the string \c replace. * @@ -549,12 +544,13 @@ replace_default_in_ncp_ciphers_option(struct options *o, const char *repla= ce) { const char *search =3D "DEFAULT"; - const int ncp_ciphers_len =3D strlen(o->ncp_ciphers) + strlen(replace)= - strlen(search) + 1; + const size_t ncp_ciphers_len =3D strlen(o->ncp_ciphers) + strlen(repla= ce) - strlen(search) + 1; uint8_t *ncp_ciphers =3D gc_malloc(ncp_ciphers_len, true, &o->gc); struct buffer ncp_ciphers_buf; - buf_set_write(&ncp_ciphers_buf, ncp_ciphers, ncp_ciphers_len); + ASSERT(ncp_ciphers_len <=3D INT_MAX); + buf_set_write(&ncp_ciphers_buf, ncp_ciphers, (int)ncp_ciphers_len); const char *def =3D strstr(o->ncp_ciphers, search); @@ -571,10 +567,6 @@ o->ncp_ciphers =3D (char *)ncp_ciphers; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - /** * Checks for availibility of Chacha20-Poly1305 and sets * the ncp_cipher to either AES-256-GCM:AES-128-GCM or -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1452?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: I380e842b7429060d13bc0264e55fa5c06ab427df Gerrit-Change-Number: 1452 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --tOlpDJGx718= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #2 to the change originally created by flichtenhel= d.

View Change

The following approvals got outdated and were remove= d: Code-Review+2 by plaisthos

ssl_ncp: Avoid conversion warni=
ng in replace_default_in_ncp_ciphers_option

Change-Id: I380e842b7429= 060d13bc0264e55fa5c06ab427df
Signed-off-by: Frank Lichtenheld <frank@= ...2641...>
Acked-by: Arne Schwabe <arne-openvpn@...1227...>Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1452
Message-Id: <= ;20260122125829.108470-1-frank@...2641...>
URL: https://www.mail-arch= ive.com/openvpn-devel@lists.sourceforge.net/msg35391.html
Signed-off-by:= Gert Doering <gert@...1296...>
---
M src/openvpn/ssl_ncp.c
= 1 file changed, 3 insertions(+), 11 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/52/1452/2
<=
span>diff --git a/src/openvpn/ssl_ncp.c b/src/openvpn/ssl_ncp.c
<= span>index 1a2405c..20fd2f0 100644
--- a/src/openvpn/ssl_nc= p.c
+++ b/src/openvpn/ssl_ncp.c
@@ -534,11 = +534,6 @@
}
}

-#if defined(__GNUC__) || de= fined(__clang__)
-#prag= ma GCC diagnostic push
= -#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
/**
* Replaces the = string DEFAULT with the string \c replace.
*
@@ -549,12 +544,13 @@

replace_default_in_ncp_ciphers_o= ption(struct options *o, const char *replace)
{
= const char *search =3D "DEFAULT";
- const int ncp_ciphers_len =3D strlen(o= ->ncp_ciphers) + strlen(replace) - strlen(search) + 1;
+ const size_t ncp_ciphers_len =3D = strlen(o->ncp_ciphers) + strlen(replace) - strlen(search) + 1;
uint8_t *ncp_ciphers =3D gc_malloc(ncp_cipher= s_len, true, &o->gc);

struct = buffer ncp_ciphers_buf;
- buf_set_write(&ncp_ciphers_buf, ncp_ciphers, ncp_ciphers_len);
+ ASSERT(ncp_ciphers= _len <=3D INT_MAX);
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
/**
* Checks for ava= ilibility of Chacha20-Poly1305 and sets
* the ncp_cipher = to either AES-256-GCM:AES-128-GCM or

To= view, visit change 1452. To unsubscribe, or for help writing mail filters, vis= it settings.=

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I380e842b7429060d13bc0264e55= fa5c06ab427df
Gerrit-Change-Number: 1452
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --tOlpDJGx718=--