From patchwork Tue Nov 24 19:06:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5783 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:91c9:10b0:11b:d6c:f273 with SMTP id tl9-n1csp4680727lad; Tue, 24 Nov 2026 11:06:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErG+GEYyTsGeybHlFYOFT9rnPKYn4UnKZaeRGE34UsTipPBN7SboNpRNf0LQ1i+McVUmY43BSMBbux4=@openvpn.net X-Received: by 2002:a05:6870:1696:b0:47c:b297:d4f0 with SMTP id 586e51a60fabf-4bc83075289mr13442848fac.29.1795547203401; Tue, 24 Nov 2026 11:06:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795547203; cv=none; d=google.com; s=arc-20260327; b=OO3W/Y1qZOWaGLTnsuBUTD30MNQbRp4vFqioE1yYL3LdSas1k5MhgKOq9/4Eq1HfIl hikT3IUdCAs2utvsvIjJOf+PIXHCsASB7H2xXz2CmI/vAQZOzw/zfe/FqQJQQbWiPuai mUVgEpvLyx9LpvyIgRp6xuv1J9FkfwD73ptLQYNSMzToJ4eqF9xPcm+Q+yW1SM29sUHb qcTX0nyZmBvtuam5tLDjElXi5FlYS2OTAH10Iv7KucuIljNUXcBo5990hTQ6DXtgBvrb DG0Mb9z6OH1b+BlTFgQ+kmRbphONEHgS1lxNBGyuKyuFvpm/+3884BrL3ndCYJTOJo/2 PfeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; 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=x0t1cCAvaI+w/VUGzQIJ0v4/pLZ33K5RixqreFB+pL4=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=n7OcDM4YGN5+vBPzofy3eRPqXVwiezMD4GoKbeelPe0Ixl/qqFa8WixPSGb5shzzWk tkUUDv1b+kVbNjYn8XuadLdd6tZUGu4rbBEBNk1ZzYzNZtQJsq0p7PiN8Z63MVja6Z1S O2CAEPu9fS2US0qcf+I+5/lFFY3BdkQwFk6o1S+w9q2o1BENau5Ks2ICp1Wky8gxFsjU 0pu8UQ05UIS5vAQZg4rHfNeFEPze15N3EXds+w7lnxCcv1Bek+ZUOFXBHHjdukLFOdZS Fbt4vax/WWpVQttpnkwSdU73kq44DLrrycUbmrEod8f1+N2tyi8tM0GPEgq07vKMlZ1Y ywXg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=cH7DvuT0; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=V7W2Brie; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=HLrAkqAC; 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-4bc61080f41si22518902fac.159.2026.11.24.11.06.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Nov 2026 11:06:43 -0800 (PST) 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=cH7DvuT0; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=V7W2Brie; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=HLrAkqAC; 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-Unsubscribe-Post: List-Owner; bh=x0t1cCAvaI+w/VUGzQIJ0v4/pLZ33K5RixqreFB+pL4=; b=cH7DvuT0mFSWj4 3grp6B4fHeTZ5duu009yLkFdweVMqDmQfchkyd3lpZq456CA5rJUXARDqc191ijfgLdN9+aZzYQkF enFGB5rfWsu40+b8lhKLsYHoxzaajEyg58tmIGs0/Oks2yG4SqS+ylhGdBwUeOBanxuWdVyeOGNXG woc=; 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.100.1) (envelope-from ) id 1xVvqk-000000006Vx-11az; Tue, 24 Nov 2026 19:06:42 +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.100.1) (envelope-from ) id 1xVvqi-000000006Vp-2GDY for openvpn-devel@lists.sourceforge.net; Tue, 24 Nov 2026 19:06:40 +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-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hokgQrmBsas4JamcnyhVBetepn2feT2sSy4OsOzqRho=; b=V7W2BrieI9DtF2+99ApDRqt5Gk NryxZkA31dEYtLKn1iibW0bS0Ovq0ZYrJ2U6Z0rlrOmINXW+mGIbtLM0U/DXBo5fReIE1FOOGX6bK sne/g5ZcBDovb62YPxnWU0ge3MZB8xEGH7M/8M5kwaMj/rZTMvfoxRia2NjBOQpzrsAo=; 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-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=hokgQrmBsas4JamcnyhVBetepn2feT2sSy4OsOzqRho=; b=HLrAkqAC/xJErog3+eSempvTp/ AaFvmry0Nuch+CzMfYlm6+GRZl6nMSqnFNlemcRUuwe1N9mDYUdbjOswGl22T45TUJTCyKcFT+yic DodjPAI7V9y5eGtSmUP84zHrm3b/2NpXu/hDYJMYjs4BJ24ZD4PCNeYENZ23gNqfrwhM=; Received: from [193.149.48.129] (helo=blue.greenie.muc.de) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xVvqg-0000000023y-1wCF for openvpn-devel@lists.sourceforge.net; Tue, 24 Nov 2026 19:06:40 +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 6AOJ6V45016713 for ; Tue, 24 Nov 2026 20:06:31 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6AOJ6VJr016712 for openvpn-devel@lists.sourceforge.net; Tue, 24 Nov 2026 20:06:31 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 24 Nov 2026 20:06:25 +0100 Message-ID: <20261124190631.16700-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.55.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 Due to the int return of vsnprintf this is always going to be somewhat ugly. Change-Id: Id5152a5aacdd50f2fa9c5b3dfab92be8887541db Signed-off-by: Frank Lichtenheld Acked-by: Razvan Cojocaru Gerrit URL: https://gerrit.openvpn.net/c/o [...] 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: 1xVvqg-0000000023y-1wCF Subject: [Openvpn-devel] [PATCH v1] argv: Fix conversion warnings in argv_printf_arglist 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: 1882767704521835432 X-GMAIL-MSGID: 1882767704521835432 From: Frank Lichtenheld Due to the int return of vsnprintf this is always going to be somewhat ugly. Change-Id: Id5152a5aacdd50f2fa9c5b3dfab92be8887541db Signed-off-by: Frank Lichtenheld Acked-by: Razvan Cojocaru Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2340 --- 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/+/2340 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru diff --git a/src/openvpn/argv.c b/src/openvpn/argv.c index c716e5b0..cf841a5 100644 --- a/src/openvpn/argv.c +++ b/src/openvpn/argv.c @@ -323,11 +323,6 @@ return f; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" -#endif - /** * Create a struct argv based on a format string * @@ -378,9 +373,9 @@ */ va_list tmplist; va_copy(tmplist, arglist); - int len = vsnprintf(NULL, 0, f, tmplist); + int test_len = vsnprintf(NULL, 0, f, tmplist); va_end(tmplist); - if (len < 0) + if (test_len < 0) { goto out; } @@ -389,10 +384,10 @@ * Do the actual vsnprintf() operation, which expands the format * string with the provided arguments. */ - int size = len + 1; + size_t size = (size_t)test_len + 1; char *buf = gc_malloc(size, false, &argres->gc); - len = vsnprintf(buf, size, f, arglist); - if (len < 0 || len >= size) + int len = vsnprintf(buf, size, f, arglist); + if (len < 0 || len > test_len) { goto out; } @@ -423,10 +418,6 @@ return res; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - /** * printf() variant which populates a struct argv. It processes the * format string with the provided arguments. For each space separator found