From patchwork Wed Mar 4 16:48:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4799 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7001:a68f:b0:83c:d90d:321 with SMTP id wf15csp342435mab; Wed, 4 Mar 2026 08:49:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU1EhGIASvzdtth/6BfZbgKJf1alTA3xBA7K3LmJre31R7WZbDgp8cQOb2L9ZHJluxqSIpqcNnjVwE=@openvpn.net X-Received: by 2002:a05:6830:3489:b0:7cf:d05f:3e57 with SMTP id 46e09a7af769-7d6d13b17b9mr1465945a34.25.1772642959824; Wed, 04 Mar 2026 08:49:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772642959; cv=none; d=google.com; s=arc-20240605; b=ap1dE8mLSNWsSVRi/jfq28VRCVC77/fLAxC013MHgbrL8L6ahmimVRg2Gt6A0UhMZj umtqOSBUVV4hEWGbBZesPqNuUAw9muob1Hlk/nDUZXyKp5Yoy24K6fUQE6FrlfAnAFmI ntlcmBJWEShepJMvBam0AO6CzJb7X0iHHfpCIUCZmyz+ZvdZPX5WiEEkPG+Vq9yBYIMe 5POLl/rsx9/SHLqpkORgr01Oc3RN8uK+Vjr03sa486UeOd8xaMf9lNDbEN0hofabcARx bP5Fm5KCCdEs/9MVYA0L1qzWKDo4/vsaedC/rAguWiTQJWad26xXevezj+IaoOoUNl02 4P/Q== 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=axAJaD4PYrPK5HuQhHqce7gpRMnlZVh3kpyacE+yA6c=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=Uiux04f723z8eI/OPNfrx40ynMszQV1GGPhIT15clqwY1iXu0+xVrcBIduClM4jfHL 4pcmtbprCoaPhz0zhwcdCmZ0cHgnV+O9crl1nK8r8HDy0n1gVzXLdjdnpS8Ght8tFqOP 1QtGG+8jYBQYm9edtLGosTqM1XNxF+LdMEGhLPXP3d5a9EwFYO9XaKTAnj+3MSEs/pJG TynSopK7g9H1LhZ+Gd9HaD4ETaQUXJryOSPBx+192P9bFyU64CrV9fSK7trV+CRtyr80 DTCyuVevIF9DlSQdTxW+Ddj1zx+4F1nOvK96XdoWAfBSYpxUeRj5FlnBUHCW+13HE1VG vHSg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=NMLfneiF; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=C7JM+nd6; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=NVfDQw8u; 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 46e09a7af769-7d586472c39si12514478a34.33.2026.03.04.08.49.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2026 08:49:19 -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=NMLfneiF; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=C7JM+nd6; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=NVfDQw8u; 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=axAJaD4PYrPK5HuQhHqce7gpRMnlZVh3kpyacE+yA6c=; b=NMLfneiFHR9tW6+2JG92C/goxs bDmOtfr+x7HNmjOo7DZE9TOF7nuu/Xaud2+Co8Kueg5EUGjfxpH1Lq3iPSQrK5XPXIaS2/3EBGh9M SvGLqRDt9lvy4W/lxOfCTfZpkSWrg3/oHim+j9rQAF81qN1XnP8RLLVM/cMt6J6HiuKc=; 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 1vxpPQ-00012V-V9; Wed, 04 Mar 2026 16:49:17 +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 1vxpPP-00012D-UH for openvpn-devel@lists.sourceforge.net; Wed, 04 Mar 2026 16:49:16 +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=rokszKVNQBXZnHsAqNxdejV42zC4JRQvkbN6DdVN/SY=; b=C7JM+nd6XglpOFaJxqPNzCJ8yq 3SGwDmysJKmTnxmrP0H+iOGrV+ushwZ3Ms/hGGEKrgrhcfnSu4QG/CrGZAw4oTXy67UQXpvTJx5iR JfdRGWQ52J3OTfYx0uARct+KH5qukHzvZkhR1H5/juerogwV4utSY2VFPH9fzkPDn/K8=; 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=rokszKVNQBXZnHsAqNxdejV42zC4JRQvkbN6DdVN/SY=; b=NVfDQw8uvfZIdn3r2Yft/Y74YE 3EQP95ZoRmBaEgBiz877qE5kWo9v122yuJQEuCZu/KyU2aMsrYuaSV2I/NF89NxB4RnZboKf3GWhH Vd2hXrFdqC6z/KuZUpX/FA6J/rPsGPObu6I0F3yYLZFXMHL/m2LMs6/OJ5jklNcENxG0=; 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 1vxpPP-0003Rq-VA for openvpn-devel@lists.sourceforge.net; Wed, 04 Mar 2026 16:49:16 +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 624Gn4vc015757 for ; Wed, 4 Mar 2026 17:49:04 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 624Gn4Wx015756 for openvpn-devel@lists.sourceforge.net; Wed, 4 Mar 2026 17:49:04 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 4 Mar 2026 17:48:58 +0100 Message-ID: <20260304164904.15743-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.52.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 Avoid sign-compare warning and do not ignore error return values. Change-Id: I7be033bc88e9a6ba474916c8be039c126e8bc574 Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c [...] 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: 1vxpPP-0003Rq-VA Subject: [Openvpn-devel] [PATCH v5] push: Improve check of vsnprintf return value 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?1858750863778136523?= X-GMAIL-MSGID: =?utf-8?q?1858750863778136523?= From: Frank Lichtenheld Avoid sign-compare warning and do not ignore error return values. Change-Id: I7be033bc88e9a6ba474916c8be039c126e8bc574 Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1502 --- 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/+/1502 This mail reflects revision 5 of this Change. Acked-by according to Gerrit (reflected above): Arne Schwabe diff --git a/src/openvpn/push.c b/src/openvpn/push.c index d13b24a..a948973 100644 --- a/src/openvpn/push.c +++ b/src/openvpn/push.c @@ -800,11 +800,6 @@ gc_free(&gc); } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - bool send_push_reply(struct context *c, struct push_list *per_client_push_list) { @@ -936,7 +931,7 @@ va_start(arglist, format); len = vsnprintf(tmp, sizeof(tmp), format, arglist); va_end(arglist); - if (len > sizeof(tmp) - 1) + if (len < 0 || len >= (int)sizeof(tmp)) { return false; } @@ -944,10 +939,6 @@ return true; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - void push_reset(struct options *o) {