From patchwork Sat Aug 15 13:08:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5243 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:798a:b0:87d:ab56:3700 with SMTP id o10csp875392maz; Sat, 15 Aug 2026 06:09:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AHgh+RqaKsr9vjZ4cUUzSVHDBpOAUYN8QtulDOUQZZU1CLzV8hVbXaE67M1++9KOft1qDbQlV5gvxWB739w=@openvpn.net X-Received: by 2002:a05:6808:6808:b0:4a0:cf55:3cf0 with SMTP id 5614622812f47-4b24152d08fmr10890512b6e.9.1786799349704; Sat, 15 Aug 2026 06:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1786799349; cv=none; d=google.com; s=arc-20260327; b=U+hBru7dN0D3a0ec+gvfolCEXSQjoryjp4hXZVm6VUDzOxiVov8cJGp/QqnRXy5IEJ HQNE/2Sl/oDq5F9X7gRBiyY4sJg/xtkgKfPWQESLpdVZudlQdqukfPXMSIVWjRx3E4Mm MA8GIPGAYCzjL5IZ0m/wZN3VXNvWSU9Pnl6FPl0x8BQ5ZWgXzK8+j5qjgu25w5ICnxGI 1tB8BfSf+aemTF0NQ6kSSroCO53fSMVH3aaAFfOY4AZM+bVrI8BnDWb2TiTMTq6y76/v f1xp/TjB+WLk4NES8O3rIkpi+a7+9Y4df6q/kPaaXTWFFGkSJxlCGrEJbkRTG4rJ2qmN 0u6Q== 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=hSZi8o0LhstucNT0OEqd6HIo88C3OZX9k+NdoyL7nnU=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=iQZHQNKygAWdzPXIG5hRLHwKiqAhRyIg5X/7XCKdYciaoDFIhxMPWG+upQzpuHrXyf uZoCX/gRlCaCAEVtGZpzd7sg13M0vLe6TYsFZYHZk+dFlX9qDAMAtwnihLjz/zAr9huv +yKyHxohblMHS+YvW3jfs5bZ5UFJeGGt+IsdL4LXa+DcETTgM4ScArlvKn0sQ1gm3VEE sRDmTUMbDV/yPfOBbQp8u2Bvyx1h7xLOx2Dc0s0OztCsp9CRS5uosq4MbeUoDa6GJ6GV TyiMlQOCAG47rpRbUVQsRsTF6PuMv+GnQsUXJwccLHGIey7tzNyb8EfPA5G3szNLdQAM YTxg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=ffJXQcw6; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=nUtNYjMj; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=P5xhLecn; 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 5614622812f47-4b24dbe2ea1si7451683b6e.84.2026.08.15.06.09.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Aug 2026 06:09:09 -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=ffJXQcw6; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=nUtNYjMj; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=P5xhLecn; 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=hSZi8o0LhstucNT0OEqd6HIo88C3OZX9k+NdoyL7nnU=; b=ffJXQcw6mTsXWKb7IHCN6sAhC/ effKlFTut+3kXJPjBGKYlxIMiz1PjJ9aClDboG5d5DdXS2XuxwDFcRVrfcapqgMLitO04bJCcSUcy leud3rBEYauw5A1ZDvfp/Zw6ht3oY/6UKjI7+HaRPOycnAk6r3vIrwn6iwShNzFN3MB0=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wvE8H-0008Sw-Fk; Sat, 15 Aug 2026 13:09:06 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wvE8F-0008Sf-Gp for openvpn-devel@lists.sourceforge.net; Sat, 15 Aug 2026 13:09:04 +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=0M5NrA2qFlt3ZvaN4J2vqBqp9sz3JsFD+df1yY5sbOI=; b=nUtNYjMjJyPmATIMwO+khJWyTY VJXUj5v0EWo+K811QaKmAkAod32x1mWraOjhpOqUSzRUU1djM9olcf76XR1/0NDxXEDGl8ILwlMR/ n9TkfIvu815xuUUrJxqZCzp9B/lQmz6peFsdhGfqf0+si8eWatVyc06Rl5d9j/sNxWRg=; 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=0M5NrA2qFlt3ZvaN4J2vqBqp9sz3JsFD+df1yY5sbOI=; b=P5xhLecnTKTcjJVxsYcy1xGnmU 1o59VtHgK7zTEcRqe8D5y9EiMDHDibZHitxKDCe6FzOt8gxJ71iwWHAFnCWsEMMJY6qqE80htdXSa a8u4M8+eDajLfUATMee3UmVg6i7eH1brqqLxqJKmwLmx4w++EYWYqiCavY6QK5mvD+3k=; 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 1wvE8F-0000QO-CG for openvpn-devel@lists.sourceforge.net; Sat, 15 Aug 2026 13:09:04 +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 67FD8uea020449 for ; Sat, 15 Aug 2026 15:08:56 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 67FD8uKY020448 for openvpn-devel@lists.sourceforge.net; Sat, 15 Aug 2026 15:08:56 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sat, 15 Aug 2026 15:08:49 +0200 Message-ID: <20260815130856.20431-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-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 - Use BLENZ instead of buf_len where applicable - Fix some comparisons with ce list length Change-Id: Ie0b94b596637d660392bc4eda48d16cfecfeb971 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: 1wvE8F-0000QO-CG Subject: [Openvpn-devel] [PATCH v8] init: Avoid sign-compare warnings 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: 1873594914846576292 X-GMAIL-MSGID: 1873594914846576292 From: Frank Lichtenheld - Use BLENZ instead of buf_len where applicable - Fix some comparisons with ce list length Change-Id: Ie0b94b596637d660392bc4eda48d16cfecfeb971 Signed-off-by: Frank Lichtenheld Acked-by: Razvan Cojocaru Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1562 --- 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/+/1562 This mail reflects revision 8 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru diff --git a/src/openvpn/init.c b/src/openvpn/init.c index caaa769..2196364 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -325,11 +325,6 @@ return l->len; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - static bool management_callback_remote_entry_get(void *arg, unsigned int index, char **remote) { @@ -340,7 +335,7 @@ struct connection_list *l = c->options.connection_list; bool ret = true; - if (index < l->len) + if (l->len > 0 && index < (unsigned int)l->len) { struct connection_entry *ce = l->array[index]; const char *proto = proto2ascii(ce->proto, ce->af, false); @@ -364,10 +359,6 @@ return ret; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - static bool management_callback_remote_cmd(void *arg, const char **p) { @@ -466,7 +457,6 @@ #if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wsign-compare" #endif /* @@ -638,8 +628,8 @@ } while (!ce_defined); /* Check if this connection attempt would bring us over the limit */ - if (c->options.connect_retry_max > 0 - && c->options.unsuccessful_attempts > (l->len * c->options.connect_retry_max)) + int max_attempts = l->len * c->options.connect_retry_max; + if (max_attempts > 0 && c->options.unsuccessful_attempts > (unsigned int)max_attempts) { msg(M_FATAL, "All connections have been connect-retry-max (%d) times unsuccessful, exiting", c->options.connect_retry_max); @@ -2176,7 +2166,7 @@ static void add_delim_if_non_empty(struct buffer *buf, const char *header) { - if (buf_len(buf) > strlen(header)) + if (BLENZ(buf) > strlen(header)) { buf_printf(buf, ", "); } @@ -2264,7 +2254,7 @@ buf_printf(&out, "session-timeout %d", o->session_timeout); } - if (buf_len(&out) > strlen(header)) + if (BLENZ(&out) > strlen(header)) { msg(D_HANDSHAKE, "%s", BSTR(&out)); } @@ -2301,7 +2291,7 @@ } } - if (buf_len(&out) > strlen(header)) + if (BLENZ(&out) > strlen(header)) { msg(D_HANDSHAKE, "%s", BSTR(&out)); }