From patchwork Fri Jun 12 11:04:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5026 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:34c4:b0:861:c897:cb9d with SMTP id a4csp589230mag; Fri, 12 Jun 2026 04:05:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AFNElJ+VitjALfu17Cn5gbl7yLDpFRmsxOp7lRdonuVOF249IJ4lE9eVziOntoN4EM23JV+fdY0EjHLCtuo=@openvpn.net X-Received: by 2002:a05:6820:214:b0:69d:8555:c458 with SMTP id 006d021491bc7-69edc675fbbmr1448080eaf.24.1781262305935; Fri, 12 Jun 2026 04:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781262305; cv=none; d=google.com; s=arc-20240605; b=FNDn9LFmE2Bi1JmXswP8lQHdh6FM2sqIU4xCkUNn5DP3J8SkqBJIo+Krrcut47aY08 KdmPmwvQEbMpgh8gL5CpT4ECSYP/USoFUg8we3WeLTLX2om/6jq0MimlzisyelbY2+ji 1xdml3/LC1Vhx0uQJnTGJo250dJO8k0fON3vYPqA0Hz03ExgssZ2cJgfaePpabOs6noQ hWjB1eNxkqdcxB9jEhtjHJA65tAaaTEAbbVgMJCQ9wsnCz0Hbm+IP6k06RsvVr3E+6Im sTfVbckNhePfkZqYz+UZ0g1EhZpeShZyKZ/jQB2qNj7EpDe6XGufZKcTW0XF1ppBmKMR TyFQ== 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=qbMh94pNeGaEwM6E1fB0jUGQl8bSmGSCu5Jv4Tsiof4=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=djQ33fXnEf4rhj/waMbIEenAb5Rx8fEjN6WnkY2CXDdH4sAgsvfFqbGVaq3Jo10Uhh TSq2WLkxrI5b9k+2oa9zz9zlCdmxmUKYPPrc3Of9S7SraCChvZxej5IGvm3Zc4m7lxh1 D0ixHds2xvsv13TGsdjlZaB4cvRYVeepIeHZ2Hxkw4TOCBMUMOAxmD+EejY1ajgs4F4k 2Vgi/2vL8GMY2FHRdJ3levV4eq3vW0PN+uRVxY8EgypsHzP2UVBT4daXrrQFWMgxbdUi SzPzkArZtxr8CB0POI5K9QMdbH5yPh2B7zAV7YbDLx5b6rZ7Ye/F8MnJKTNvaFHefWww 07/Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b="kL0HnAU/"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="NJS/tmRI"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=GHQVqOtt; 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 006d021491bc7-69ed8357c9csi1283476eaf.17.2026.06.12.04.05.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jun 2026 04:05: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="kL0HnAU/"; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="NJS/tmRI"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=GHQVqOtt; 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=qbMh94pNeGaEwM6E1fB0jUGQl8bSmGSCu5Jv4Tsiof4=; b=kL0HnAU/jPzfafsNDNs14B3LT3 LsUKNta1LhMXWkes/eEGp4sEsqUIAzoO1lcG2eYs8JAVv0RwxYWY8yx+wBdDiCNQsE0cKYU2WcyTk t9ykEW9gf5iVDr57NX7Cb89UhQ7WHFuBLgtxiD1ZhB9PutpqCED4Kpd38MfHz44ciOV4=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wXzh7-0004Ix-9b; Fri, 12 Jun 2026 11:05:01 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wXzh5-0004Hz-Os for openvpn-devel@lists.sourceforge.net; Fri, 12 Jun 2026 11:04:59 +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=K6vDFlQbTuSPS/CHr9Ru0xMldL78Ql1N+y4gg6k8N2c=; b=NJS/tmRIxdeKcQctUCWvn95qjS aio8Fp/ueT3czfg9qTmxs4h9FxPpb7nyl3ixrSZROGGu6mqbQRMCpYorutOMcvOQ3vI6HvIzrBPN0 5ySGZX1ZA7Kwfqq27zySSSCF6J8dcOrIsCkRYTpuiO2/d/GFAY6GSTDRAFMhHfcOBtaI=; 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=K6vDFlQbTuSPS/CHr9Ru0xMldL78Ql1N+y4gg6k8N2c=; b=GHQVqOtt1778ChP5LJIwS36lGD S0Fq7O3IzthTg8bRLrNL08juW1XFnOwADcGiLE6i1QntDBk20lQ1hZeC+Y5JzKdBrtrUjXm2MuRrk pnl9be5ChzqvihB1TLSVIywXAN1hxJRaHXSZCrlyBUCoJ1CEFG6eMrGSbX2gc19o+ulg=; Received: from [193.149.48.129] (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 1wXzgi-0007tf-Qc for openvpn-devel@lists.sourceforge.net; Fri, 12 Jun 2026 11:04:38 +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 65CB4P6V027050 for ; Fri, 12 Jun 2026 13:04:25 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 65CB4PK1027049 for openvpn-devel@lists.sourceforge.net; Fri, 12 Jun 2026 13:04:25 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 12 Jun 2026 13:04:17 +0200 Message-ID: <20260612110424.27033-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.53.0 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 Mostly these were actually hidden by casts, but fix them as well by using more fitting types. Change-Id: I1d4e0233cf1cb09725dbd2caa121acdbf62f0452 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/open [...] 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: 1wXzgi-0007tf-Qc Subject: [Openvpn-devel] [PATCH v6] mbuf: Fix conversion warnings in mbuf and related code 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: 1867529359571807934 X-GMAIL-MSGID: 1867788903944889701 From: Frank Lichtenheld Mostly these were actually hidden by casts, but fix them as well by using more fitting types. Change-Id: I1d4e0233cf1cb09725dbd2caa121acdbf62f0452 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1433 --- 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/+/1433 This mail reflects revision 6 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/buffer.c b/src/openvpn/buffer.c index 1e19137..5f2b233 100644 --- a/src/openvpn/buffer.c +++ b/src/openvpn/buffer.c @@ -43,7 +43,7 @@ unsigned long long res = (unsigned long long)m1 * (unsigned long long)m2 + (unsigned long long)extra; if (unlikely(m1 > limit) || unlikely(m2 > limit) || unlikely(extra > limit) - || unlikely(res > (unsigned long long)limit)) + || unlikely(res > limit)) { msg(M_FATAL, "attempted allocation of excessively large array"); } diff --git a/src/openvpn/mbuf.c b/src/openvpn/mbuf.c index 5e1b585..7b790ed 100644 --- a/src/openvpn/mbuf.c +++ b/src/openvpn/mbuf.c @@ -34,11 +34,6 @@ #include "memdbg.h" -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - struct mbuf_set * mbuf_init(unsigned int size) { @@ -46,22 +41,17 @@ struct mbuf_set *ret; ALLOC_OBJ_CLEAR(ret, struct mbuf_set); - ret->capacity = adjust_power_of_2(size); + ret->capacity = (unsigned int)adjust_power_of_2(size); ALLOC_ARRAY(ret->array, struct mbuf_item, ret->capacity); return ret; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - void mbuf_free(struct mbuf_set *ms) { if (ms) { - int i; - for (i = 0; i < (int)ms->len; ++i) + for (unsigned int i = 0; i < ms->len; ++i) { struct mbuf_item *item = &ms->array[MBUF_INDEX(ms->head, i, ms->capacity)]; mbuf_free_buf(item->buffer); @@ -145,8 +135,7 @@ struct multi_instance *ret = NULL; if (ms) { - int i; - for (i = 0; i < (int)ms->len; ++i) + for (unsigned int i = 0; i < ms->len; ++i) { struct mbuf_item *item = &ms->array[MBUF_INDEX(ms->head, i, ms->capacity)]; if (item->instance) @@ -164,8 +153,7 @@ { if (ms) { - int i; - for (i = 0; i < (int)ms->len; ++i) + for (unsigned int i = 0; i < ms->len; ++i) { struct mbuf_item *item = &ms->array[MBUF_INDEX(ms->head, i, ms->capacity)]; if (item->instance == mi)