From patchwork Tue Nov 10 12:36:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5646 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:20a6:b0:11a:a05e:cb97 with SMTP id 38csp972547lad; Tue, 10 Nov 2026 04:37:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErHuU39UUAzaOYhv+2ktUZR3vLrIEi1UjwQiNNXRrSvTnYHD6rBgRVOjFhi+lUTL9Lzenk0afb5gXp0=@openvpn.net X-Received: by 2002:a05:693c:8312:b0:36a:2473:9b2f with SMTP id 5a478bee46e88-3750a20b93bmr3437213eec.23.1794314232169; Tue, 10 Nov 2026 04:37:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1794314232; cv=none; d=google.com; s=arc-20260327; b=WU7EyDCqvs+KMiPIm9uGYmowUTzT5EGIKoxfwwGg3QL0ZEgvHzau29ikQkcMo4lziF nkO0CzhSfX9zca889ONE1Fo/86jnCVn7GGUK0qaNS8Ml/L6mGVnhQwd/kVBu745xyh16 z1Wy1T0EltzdmkO2/l1hQVry9Npqz2a8DcobCoVZrWQQjqasAZtBl3hXtRBSMHvhjgYB bxiPpeWRNYXuw5vMNxonqOJGhqlJGXTUsqwutk4LdCnweaBh8CuFoHs53wR2E+jHPSox cHelR+sb++KqJVq1ga4KTNMtDNkD8WdKSEQT8fK1hSRqhL+cRNFEkPbFMPyBYe6QKgKr p8+A== 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=NciJNDna5rk1eLGHN3ZdYAJtM/yVZPI9i+tfnjGi48o=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=U4KZz+nDmC0YwSZBbilqwWJVjU3yv0mLvY5m/BrvkQUN/jpaln/DhO8KzAh2yWHQkV 6sHs4L6wyt4Qgcjte++AP6sIuVZH7NWXrCKYDSITq2sAEVJyRpt3metDpBs/LW4eSEql UtDBZcgSjfbhhddBRnH4ia3gDncunJRBu0JfG1CGO2aeatEhfoubH1kSJ5LflM/cfz6R E50UsLdGXswPRnp9uqeZ0tzE8Ml6hnZ8pWcY6Im8OqXsZU3fiO//qXuvItUQq8dvHfQ3 by4lQbJh9NxsL8+bmpXqzuqRGp4HZZ4TF9Z3aWtQcPYD+8j+HbIqGUUaJLo2nWkIh8dV 0giw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=inMKeXWP; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=dnK8KpKC; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=W6ByHlY5; 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 5a478bee46e88-3751dce4a8csi5352286eec.11.2026.11.10.04.37.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2026 04:37:12 -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=inMKeXWP; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=dnK8KpKC; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=W6ByHlY5; 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=NciJNDna5rk1eLGHN3ZdYAJtM/yVZPI9i+tfnjGi48o=; b=inMKeXWP+a4/b1 e/cCn8DKPZSmyjxg8fTnuAsncVRaklEg1Mipa3d1lSooPxfpmDYM/IaQ6nl34sHCUAErerraF+Kgg BvgaWWz5AMMYcrVjuYmwcqeeyGXbwuHEIzd9qnv64oonA0JNCr8X69pUpU8fSiX2Fe2NtSohvhRs5 2PE=; 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 1xQl66-000000001dJ-2Zr3; Tue, 10 Nov 2026 12:37:10 +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 1xQl65-000000001dD-1H06 for openvpn-devel@lists.sourceforge.net; Tue, 10 Nov 2026 12:37:09 +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=CpERbxW2My/+7fODDn23CK7qQQEjrfA47yC2vxBycW4=; b=dnK8KpKCdW4aynaE2YxoU2OFox vyUfkwXgLda7IbXNyWIPFwJVthj+GdG2BEx5yW4r4EB8E7fixOoi/WuX8IuYbY5a9UvNa3UKBuj1N p7EQ8Y7qvKaSM1ow3nW0yYNqhUI0EuY9aKLZKNyR7SykXCMp7SNIgjo2sLFFiRxY1tJw=; 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=CpERbxW2My/+7fODDn23CK7qQQEjrfA47yC2vxBycW4=; b=W6ByHlY5+AP1qBd08Xoz8bC7CL uuKZOcHCS6KpMVA3stwoIFJQP2DwI++nHhofNWUajQrO8xL6AMy9S6iGh2X2y23nSjQyNvR0Z9Xhe DMxsy9yLyJMgW//cNPTSkHj0NLCBYDPSDoxsm+7ZV3Ejwcg/IzQ0V4czXfvkujqMl+ig=; 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 1xQl62-000000005k9-1rwO for openvpn-devel@lists.sourceforge.net; Tue, 10 Nov 2026 12:37:09 +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 6AACaxCQ004695 for ; Tue, 10 Nov 2026 13:36:59 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6AACaxbr004694 for openvpn-devel@lists.sourceforge.net; Tue, 10 Nov 2026 13:36:59 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 10 Nov 2026 13:36:53 +0100 Message-ID: <20261110123659.4683-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-1.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 All callers already want a size_t, so make the conversion implicit. Change-Id: Ie2d784272184261a62c848e6ad3b7a4570ae6dc7 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 ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_DNSWL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to DNSWL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block for more information. [193.149.48.129 listed in list.dnswl.org] 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1xQl62-000000005k9-1rwO Subject: [Openvpn-devel] [PATCH v1] buffer: Change return type of buf_forward_capacity_total to size_t 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: 1881474840393027479 X-GMAIL-MSGID: 1881474840393027479 From: Frank Lichtenheld All callers already want a size_t, so make the conversion implicit. Change-Id: Ie2d784272184261a62c848e6ad3b7a4570ae6dc7 Signed-off-by: Frank Lichtenheld Acked-by: Razvan Cojocaru Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2165 --- 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/+/2165 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru diff --git a/src/openvpn/buffer.c b/src/openvpn/buffer.c index 5f21de8..a4e2809 100644 --- a/src/openvpn/buffer.c +++ b/src/openvpn/buffer.c @@ -275,7 +275,7 @@ if (buf_forward_capacity(buf) <= 1) { size_t len = strlen(str) + 1; - if (buf_size_valid(len) && (int)len < buf_forward_capacity_total(buf)) + if (buf_size_valid(len) && len < buf_forward_capacity_total(buf)) { memcpy(buf->data + buf->capacity - len, str, len); } diff --git a/src/openvpn/buffer.h b/src/openvpn/buffer.h index ede3066..ae6dcb7 100644 --- a/src/openvpn/buffer.h +++ b/src/openvpn/buffer.h @@ -1068,7 +1068,7 @@ * * @return Capacity minus offset, or 0 if \c buf is invalid. */ -static inline int +static inline size_t buf_forward_capacity_total(const struct buffer *buf) { if (buf_valid(buf)) @@ -1078,7 +1078,7 @@ { ret = 0; } - return ret; + return (size_t)ret; } else { diff --git a/tests/unit_tests/openvpn/test_dhcp.c b/tests/unit_tests/openvpn/test_dhcp.c index e331d3d..3a84e1e 100644 --- a/tests/unit_tests/openvpn/test_dhcp.c +++ b/tests/unit_tests/openvpn/test_dhcp.c @@ -50,11 +50,6 @@ return "dummy"; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" -#endif - static void test_write_dhcp_search_str(void **state) { @@ -146,10 +141,6 @@ gc_free(&gc); } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - int main(void) {