From patchwork Sun Oct 18 15:41:45 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5489 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:848c:b0:8dc:5c83:a4ec with SMTP id z12csp498571max; Sun, 18 Oct 2026 08:42:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBxaFxZAC9iI5vCQ3nHZsvc6Ha0LzgKj0fGJ4qHGAFZx3CGoCl8dwksceCL8R973vnLn2OshgZQBsIY=@openvpn.net X-Received: by 2002:a05:6830:4421:b0:81b:9724:8724 with SMTP id 46e09a7af769-844fe783338mr4952586a34.11.1792338133569; Sun, 18 Oct 2026 08:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1792338133; cv=none; d=google.com; s=arc-20260327; b=sFHdpALEb/D9KT3TtGd5SVrs89J090Lu3vhBh2nHItQE+mgXU8xZo/IU/ca92v6EYx 26vxQ55vfIsG7Nojm/ANQSdULdI7KKIGBxfXcI+9Odzpx6/sDZZrDrXEMhkAyfICcLN0 EqQjm7U9iRIXOldOW2Y8NrbMH8Ppl2uXAL0fZKNrv11t6YysI4o/90MDaXmMj5Osd7hc jBXuvuGFohm78pKF84mr+DO9CtYv/V4R0ddVyokP8OSaDRkUGCGPKE1GxYgkKo5hgjIP Ew2k+vw2bn7WvKHZYyEtL4Ns0phb0/hXG+B/wlRRZL2iCOD8d9oHBbzRL94RJMDH95tT zmmQ== 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=fZa1aL3RoxUYyoH4RE5WSvuhx096e89RY21n7a6TX7U=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=A4MUxkY3eLhjGNcmJtf2tveAcPsdjmkz1w3c8KEBrJ8nUDsbANuboyEUErRqiwwJ91 C9swQcLUv0I9bGNc+Pw541YSU1zT6ry8f+wmfoUh7SWW1xhg+IaL41OUf9N94w8LeF9J EKxrCMstAtjSjko+yRIZHpbEnyDDFLY5YOVXoMHF4HV2RDm60ILXU9ZNJ7McbEz0fK+4 76Lkng37woZlbFDH1jF7F7t7Q9jXodZy6VYAARCuCD9lHtDJ74LvcDIDqhD3WpHpI4g6 ZCs8Ad9NdtuwFtWsS80p7/gS7u6EOE5Y8voZJe6HxECepOt1nvl3CdT9QV0FlSerlaxY GltQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=C7ZmMcTv; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=h2WnQ9vU; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=HiH7Z3oJ; 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-842aaea13c3si13220553a34.130.2026.10.18.08.42.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2026 08:42:13 -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=C7ZmMcTv; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=h2WnQ9vU; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=HiH7Z3oJ; 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=fZa1aL3RoxUYyoH4RE5WSvuhx096e89RY21n7a6TX7U=; b=C7ZmMcTvrRXvPqo5lZygddSqs5 Tc+J0tQLOB/5rEKC7q11R+wZTu/0XU1yZ286AmW14Txg4A0PAmpt/ZWgD7drKrLNpvB+TNOnckRYn eRK0R4x4ZDF2s0ZZgz6ynYSk0xPrJe/grB6fno6rDbzpRmCbwBNlrFpuMmgKTcGITXjA=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1xIT1P-0007gF-Hd; Sun, 18 Oct 2026 15:42:01 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1xIT1N-0007g5-Cr for openvpn-devel@lists.sourceforge.net; Sun, 18 Oct 2026 15:41:58 +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=Lj7Oxlj8vW+2FntnxIYCE4gIDqf2yOFPboiyubFKTds=; b=h2WnQ9vUg2j+fTuxcBS1dGdtGD XIquTgOGZsGtcT1lVufms4dTN3vESuLmXJiFfu7FKgvVX8vz8qAnis0lgTsDO9uaEF+UJ4ynv/8+8 Vhm3/MeTV6QLz71R57RbhXnPPS5rAEdF3xH6yFjpMOZ09xrE2NeCvJQ9lKoRnJ0K9Bic=; 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=Lj7Oxlj8vW+2FntnxIYCE4gIDqf2yOFPboiyubFKTds=; b=HiH7Z3oJSvrm8xzHR7FtDTdisF V3lDVB7UlJ8iSt2Rnqo4cxZYJPXDl5rfaMdl+2mmjAPiuim5sKLy8sPVgdfEpdt8Royf658PNjONV zH282jEj472QMAbMlV2MOdK3umPQnsQtAP/n3qn4gcZiStFYJayE+G2P7L59tUuUn9wc=; 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.95) id 1xIT1K-0007uP-1N for openvpn-devel@lists.sourceforge.net; Sun, 18 Oct 2026 15:41:58 +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 69IFfp5J023603 for ; Sun, 18 Oct 2026 17:41:51 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 69IFfpfE023602 for openvpn-devel@lists.sourceforge.net; Sun, 18 Oct 2026 17:41:51 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sun, 18 Oct 2026 17:41:45 +0200 Message-ID: <20261018154151.23586-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 Make sure we have a sane length and convert it to int. Change-Id: I6b03ba939387c2a873105f6b6cd5f18efbf4dd4c Signed-off-by: Frank Lichtenheld Acked-by: Razvan Cojocaru Acked-by: Gert Doering 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: 1879402750678748314 X-GMAIL-MSGID: 1879402750678748314 From: Frank Lichtenheld Make sure we have a sane length and convert it to int. Change-Id: I6b03ba939387c2a873105f6b6cd5f18efbf4dd4c Signed-off-by: Frank Lichtenheld Acked-by: Razvan Cojocaru Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2005 --- 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/+/2005 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Razvan Cojocaru Gert Doering diff --git a/src/openvpn/push.c b/src/openvpn/push.c index 8dfe0d5..ad95a0f 100644 --- a/src/openvpn/push.c +++ b/src/openvpn/push.c @@ -733,11 +733,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - static bool send_push_options(struct context *c, struct buffer *buf, struct push_list *push_list, int safe_cap, bool *push_sent, bool *multi_push) @@ -748,8 +743,13 @@ { if (e->enable) { - const int l = strlen(e->option); - if (BLEN(buf) + l >= safe_cap) + const size_t l = strlen(e->option); + if (!buf_size_valid(l)) + { + msg(M_WARN, "--push option is too long"); + return false; + } + if (BLEN(buf) + (int)l >= safe_cap) { buf_printf(buf, ",push-continuation 2"); { @@ -764,7 +764,7 @@ buf_printf(buf, "%s", push_reply_cmd); } } - if (BLEN(buf) + l >= safe_cap) + if (BLEN(buf) + (int)l >= safe_cap) { msg(M_WARN, "--push option is too long"); return false; @@ -776,10 +776,6 @@ return true; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - void send_push_reply_auth_token(struct tls_multi *multi) {