From: "cron2 (Code Review)" Date: Fri, 26 Sep 2025 17:05:48 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., max@...2606... Message-ID: <71a50457772349a280e9d36a29836382e28689bb-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="TVHVM2j/vyU="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: comp-lz4: Fix types in call to LZ4_decompress_safe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: MaxF , plaisthos , openvpn-devel --TVHVM2j/vyU= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/12= 15?usp=3Demail ) Change subject: comp-lz4: Fix types in call to LZ4_decompress_safe ...................................................................... comp-lz4: Fix types in call to LZ4_decompress_safe This is ints all around but we uselessly threw some size_t conversions in there. Change-Id: Ie550dd4df65dc4fc13c839c3e745ba96e0c5c564 Signed-off-by: Frank Lichtenheld Acked-by: MaxF Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1215 Message-Id: <20250926164845.1215-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg33= 228.html Signed-off-by: Gert Doering --- M src/openvpn/comp-lz4.c 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/openvpn/comp-lz4.c b/src/openvpn/comp-lz4.c index a78c664..53a5b3f 100644 --- a/src/openvpn/comp-lz4.c +++ b/src/openvpn/comp-lz4.c @@ -88,19 +88,13 @@ compv2_escape_data_ifneeded(buf); } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - static void -do_lz4_decompress(size_t zlen_max, struct buffer *work, struct buffer *buf, +do_lz4_decompress(int zlen_max, struct buffer *work, struct buffer *buf, struct compress_context *compctx) { - int uncomp_len; ASSERT(buf_safe(work, zlen_max)); - uncomp_len =3D LZ4_decompress_safe((const char *)BPTR(buf), (char *)BP= TR(work), (size_t)BLEN(buf), - zlen_max); + int uncomp_len =3D LZ4_decompress_safe((const char *)BPTR(buf), (char = *)BPTR(work), BLEN(buf), + zlen_max); if (uncomp_len <=3D 0) { dmsg(D_COMP_ERRORS, "LZ4 decompression error: %d", uncomp_len); @@ -118,15 +112,11 @@ *buf =3D *work; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - static void lz4_decompress(struct buffer *buf, struct buffer work, struct compress_con= text *compctx, const struct frame *frame) { - size_t zlen_max =3D frame->buf.payload_size; + int zlen_max =3D frame->buf.payload_size; uint8_t c; /* flag indicating whether or not our peer compressed */ if (buf->len <=3D 0) @@ -163,7 +153,7 @@ lz4v2_decompress(struct buffer *buf, struct buffer work, struct compress_c= ontext *compctx, const struct frame *frame) { - size_t zlen_max =3D frame->buf.payload_size; + int zlen_max =3D frame->buf.payload_size; uint8_t c; /* flag indicating whether or not our peer compressed */ if (buf->len <=3D 0) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1215?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ie550dd4df65dc4fc13c839c3e745ba96e0c5c564 Gerrit-Change-Number: 1215 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: MaxF Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --TVHVM2j/vyU= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

comp-lz4: Fix types in call to LZ4_decompress=
_safe

This is ints all around but we uselessly threw some
size_t = conversions in there.

Change-Id: Ie550dd4df65dc4fc13c839c3e745ba96e0= c5c564
Signed-off-by: Frank Lichtenheld <frank@...2641...>
Acke= d-by: MaxF <max@...2606...>
Gerrit URL: https://gerrit.openvpn.net= /c/openvpn/+/1215
Message-Id: <20250926164845.1215-1-gert@...1296...&= gt;
URL: https://www.mail-archive.com/openvpn-devel@...475...= t/msg33228.html
Signed-off-by: Gert Doering <gert@...1296...>
-= --
M src/openvpn/comp-lz4.c
1 file changed, 5 insertions(+), 15 delet= ions(-)

diff --git a/src/openvpn/comp-lz4.c b/src/openvpn/comp-lz4.c
<= span>index a78c664..53a5b3f 100644
--- a/src/openvpn/comp-l= z4.c
+++ b/src/openvpn/comp-lz4.c
@@ -88,19= +88,13 @@
compv2_escape_data_ifneeded(buf); }

-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wco= nversion"
-#endif<= /span>
-
stat= ic void
-do_lz4_decompr= ess(size_t zlen_max, struct buffer *work, struct buffer *buf,
+do_lz4_decompress(int zlen_max, s= truct buffer *work, struct buffer *buf,

= struct compress_context *compctx)
{
- int uncomp_len;
AS= SERT(buf_safe(work, zlen_max));
- uncomp_len =3D LZ4_decompress_safe((const char *)BPTR(buf), (= char *)BPTR(work), (size_t)BLEN(buf),
- zlen_max);
<= span style=3D"color: hsl(120, 100%, 40%);">+ int uncomp_len =3D LZ4_deco= mpress_safe((const char *)BPTR(buf), (char *)BPTR(work), BLEN(buf),<= br>+ = zlen_max);
if (uncomp_len <=3D 0)

{
dmsg(D_COMP_ERRORS, "LZ4 = decompression error: %d", uncomp_len);
@@ -118,15 +112= ,11 @@
*buf =3D *work;
}

-#if defined(__GN= UC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
static void
lz4_decompress(struct buffer *bu= f, struct buffer work, struct compress_context *compctx,
= const struct frame *frame)
{
- size_t zlen_max =3D frame->buf= .payload_size;

+ i= nt zlen_max =3D frame->buf.payload_size;
uint8_t c;= /* flag indicating whether or not our peer compressed */
=
if (buf->len <=3D 0)
@@ -163,7 = +153,7 @@
lz4v2_decompress(struct buffer *buf, struct buff= er work, struct compress_context *compctx,
= const struct frame *frame)
{
- size_t zlen_max =3D frame->buf.payload_siz= e;
+ int zlen_max = =3D frame->buf.payload_size;
uint8_t c; /* flag ind= icating whether or not our peer compressed */

<= span> if (buf->len <=3D 0)

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

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie550dd4df65dc4fc13c839c3e74= 5ba96e0c5c564
Gerrit-Change-Number: 1215
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: MaxF <max@...2606...> <= /div>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--TVHVM2j/vyU=--