From patchwork Fri Sep 26 16:48:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4455 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:7505:b0:72f:f16c:e055 with SMTP id r5csp888378mai; Fri, 26 Sep 2025 09:49:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXUMTm0/frt6ev28d5TF+A/76F1yEKQkJmIpQUy2yQMNQXp2J3mpmRDfoX/8Hv+fnZGaIHK1B72rDk=@openvpn.net X-Google-Smtp-Source: AGHT+IFMCSwSDIcJ6Bs1Z5QELcBJ853aEEOC2cxQRDZ5G5T7yubh3Z65CvQNFzuch5b9K3gxhG+V X-Received: by 2002:a05:6870:a915:b0:322:5678:8237 with SMTP id 586e51a60fabf-35eebbb7d16mr3682673fac.51.1758905346075; Fri, 26 Sep 2025 09:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1758905346; cv=none; d=google.com; s=arc-20240605; b=TXTkfSl55zngHlrDigVW/gcZRMvJ1ZDiF9+leUR9IibQtG+Q7KV2ULvm0Djlhj0bmi eRCE8wkIzbXECFNSwnREOAuT0rnyaip6tZkaxtSSymBdRl4yJyAdnA6PDZdmv6zclRCC wooTydPKunBVkE4WPVImQM1ZifASgC0u85O95+EARhNTPegGj2TP1+oceR1taUH/idEd YFvUOhSmlfNU1HrX3QE/FlwL6pfCdL1mPPeBSjxkXktLO6vsYrad/Vs6lRDbr71g3kEY mB5tMWYBm38/6PjmY03jhU2hd2a1vlE/z4HGH87idMFmSv6EZJU/2WjHktJd9ZX5FEdD FWSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=yA3c79fOa59oGENENlOj+Xe+XaLKi09GVTiF6yB79Dc=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=fpuqUZ1sLr7Ktuq78eO6QMsluBUyCE11rwZNVIVYRPCLj9bJBdMUhh6KMaG3nqAgJV F0tV4wpyL8eLh+r7luiZEhAjCLSm2yQosoHR5Vo3h2b66SFU7de+mLrJRFgX0XmowwQD nV/03o8hnl3X7UrqPALsf87EucXHFGZU6Vr4FRLwWJ+D1iF+Ir47LfP3Hm163LawIEO+ Ciqs4n8z/L4a1DQcqo3jgA26rGFdO5wCajSqfhUQd5h+we9bJEu2RVkT7g7Ov0gvf7ye 7DzTJBkDaQqQCzEBVH2KJ1qnIqPZfCTRKVqQGumhmzKoD2bzRC+EubHidifpNn2XfRSl qsQg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=llwr4iWV; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=CBho2bpf; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=NxTgSBmt; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-363a77f67b8si1231712fac.109.2025.09.26.09.49.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Sep 2025 09:49:05 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=llwr4iWV; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=CBho2bpf; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=NxTgSBmt; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yA3c79fOa59oGENENlOj+Xe+XaLKi09GVTiF6yB79Dc=; b=llwr4iWVHtVH2ya/XHA4+izMCD J70O/N8CD/f7eL2BP0BF63OxwemX1/XzZFgceUUjb/2iKb6Sm5nDJKGpG9SAevHRkxOYeoWCg8LIv sTkpBOfvvlVKzy1e9n8ccoPhlQDsYHPoc6eca00bXTkFtp83UkWLhkmnRspDl8qqGu7U=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1v2Bcy-00023i-N4; Fri, 26 Sep 2025 16:49:00 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1v2Bcw-00023a-NZ for openvpn-devel@lists.sourceforge.net; Fri, 26 Sep 2025 16:48:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9D8F6nNG4qU4DtY1KSgECCK1Y1kT/ROlF1CmQvA4Tmw=; b=CBho2bpfH1hu6SVwFkpSKT9iqi 2jsRyMkGV68JTA4yFzyKnBzoOx0u929rj5TPu36jVKG6B0YQ18nCuE5XvQgm5e8drPJqiIshKg/up O4IG0lRicqY1Jfmc9E5MPEt5MnEHN6lYvZL1qKRX3f1bKHBlYH5qKm7nj7zceveVLyLE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9D8F6nNG4qU4DtY1KSgECCK1Y1kT/ROlF1CmQvA4Tmw=; b=NxTgSBmtMMSIaiDP7sg6XBaEdy fAgg2IfQ5suTUAcnpp/oR3DG0s4JQnLqt9nNdkmM/xKQZTRav6Ayi53aH2OlivZsgj+oMjoHacscD Qx95p9nvUMH9N7QcpJTIOv6QFqHNwIFyMkfZ7jOuuSJLk84aG6As+LLo8Xxir6SPbyyw=; Received: from [193.149.48.134] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1v2Bcv-0000R3-GF for openvpn-devel@lists.sourceforge.net; Fri, 26 Sep 2025 16:48:58 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 58QGmjKj001229 for ; Fri, 26 Sep 2025 18:48:45 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 58QGmjYb001228 for openvpn-devel@lists.sourceforge.net; Fri, 26 Sep 2025 18:48:45 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 26 Sep 2025 18:48:39 +0200 Message-ID: <20250926164845.1215-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Frank Lichtenheld 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/+/ [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1v2Bcv-0000R3-GF Subject: [Openvpn-devel] [PATCH v1] comp-lz4: Fix types in call to LZ4_decompress_safe X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1844345931822034019?= X-GMAIL-MSGID: =?utf-8?q?1844345931822034019?= From: Frank Lichtenheld 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 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1215 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): MaxF 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 = LZ4_decompress_safe((const char *)BPTR(buf), (char *)BPTR(work), (size_t)BLEN(buf), - zlen_max); + int uncomp_len = LZ4_decompress_safe((const char *)BPTR(buf), (char *)BPTR(work), BLEN(buf), + zlen_max); if (uncomp_len <= 0) { dmsg(D_COMP_ERRORS, "LZ4 decompression error: %d", uncomp_len); @@ -118,15 +112,11 @@ *buf = *work; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - static void lz4_decompress(struct buffer *buf, struct buffer work, struct compress_context *compctx, const struct frame *frame) { - size_t zlen_max = frame->buf.payload_size; + int zlen_max = frame->buf.payload_size; uint8_t c; /* flag indicating whether or not our peer compressed */ if (buf->len <= 0) @@ -163,7 +153,7 @@ lz4v2_decompress(struct buffer *buf, struct buffer work, struct compress_context *compctx, const struct frame *frame) { - size_t zlen_max = frame->buf.payload_size; + int zlen_max = frame->buf.payload_size; uint8_t c; /* flag indicating whether or not our peer compressed */ if (buf->len <= 0)