From patchwork Thu Apr 2 22:09:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Slokva X-Patchwork-Id: 4868 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:fe4d:b0:83c:d90d:321 with SMTP id da13csp1103660mac; Thu, 2 Apr 2026 15:13:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVx2J8nmaCLD1sRBYAFSaFmVhduAdDcSrTuKr2fkFVcQB5or6sxJfprfmItJb/jBV2Xhc5SJIBuaoo=@openvpn.net X-Received: by 2002:a05:6830:82ad:b0:7d9:f50f:9693 with SMTP id 46e09a7af769-7dbb7561523mr609802a34.23.1775167992980; Thu, 02 Apr 2026 15:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775167992; cv=none; d=google.com; s=arc-20240605; b=gdp9slilbjX5ReJnpoQVDVn389FkbKW5+auz77/ctDYe/q2h0Wyd1vkPhQYxI9Z+3k 9Tl/R9w5Zc+tZAWDIJ4UtbF21wKwjZ2tEpfw1yvs2mxOQqLr8mPP11oWe/o+9OCX9rEP cdcdd0kWz0r3yn0obNhS4v7aOOq5/SfSDVC3OmIPcYEG6xfNVlD7Qhee9XIdgv8YCH6U EXx++zSF2ldp/MzvyC276rwoQmBdKVtd40ZpSBYrorMSvztqNOXOdLBNL6ug2C6H01Zn uJd3HCGx6FagEoZayUTrJ8EktK0pAvQh7MeIAwiwzPKJajhWdueZXepErsNHCWyuBT/G BeQQ== 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:dkim-signature; bh=utknEKaa6eP1nNt8qpdGPKar+WhJnq64EYCd3u+2NfA=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=lOs3l8ZiFHVaLPFQBJUlgOoo/HQAC7WOhAJaRenGHzjhmp121pePBq5Nxs7huTZEC0 NI5Rd6sN66FLINrPz0t4R8RdXnYZupc7ROqfeIKf73sm+O27eg4hpon52DkBo74n3niq U2Wol2677jvxCao2TDr4/IMaUb1YPlUFMBXa5SvFL1xjqUh9plSRaTVpXICDs+QCFgC4 BH8ZGlCGJjnFKMwMswiKM9LcOxRaCfs5mV2hhb2dWBJijB3CScOc9p6PtHWKGL00VVpL 3mci5yETFBMZlg1FSe7ixzk8xVlSnsdGWg0z7dOeMVraRBUUtz+ZdjHdBzayquyPM2zi ao1g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=Hoz21j+w; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=mtKLoggk; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=ajkIvCUB; dkim=neutral (body hash did not verify) header.i=@ya.ru header.s=mail header.b=hBC8uux4; 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=ya.ru Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 46e09a7af769-7dba71a8c2esi3702308a34.43.2026.04.02.15.13.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Apr 2026 15:13:12 -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=Hoz21j+w; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=mtKLoggk; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=ajkIvCUB; dkim=neutral (body hash did not verify) header.i=@ya.ru header.s=mail header.b=hBC8uux4; 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=ya.ru 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=utknEKaa6eP1nNt8qpdGPKar+WhJnq64EYCd3u+2NfA=; b=Hoz21j+wwDXVGB0d4PyJuzQqPB 3y+zTOCyPamWDW2Az3/NYjQ4tPVTUlZ/4wYpmS/alz9YAEk0Vg8grbQNGI3DpFzBD3kqyY0KKhAlJ ydYpZdaEV3Mt39AXF7UzN4jggBdpdyAQTTbN1jkb1xlJ9rlTQ4lQW3sdvLmqkW8/be/0=; 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 1w8QHk-0002oQ-Sm; Thu, 02 Apr 2026 22:13:09 +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 1w8QHi-0002o6-F7 for openvpn-devel@lists.sourceforge.net; Thu, 02 Apr 2026 22:13:07 +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:Cc:To:From:Sender:Reply-To: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=BzqEJV71UMfe4kqC/enPiA/17s889+Y1I+5V/+FZAqo=; b=mtKLoggkGnDGk6MUisS8kRviLE xEAoGtenXL7CKhNo/6XeWb6FHyx6ZsljWgM5unutjvkM/PvlaUiVxmI5PorSCACGQ1YF0xt9krQre g3hKh0oSDfeMsl88Vue4rWyxY0cg71xD4gmeNLFqqg0MWwpRIFJBY4girdCfdr9huvD0=; 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:Cc:To:From:Sender:Reply-To: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=BzqEJV71UMfe4kqC/enPiA/17s889+Y1I+5V/+FZAqo=; b=ajkIvCUBSfhlPPEz4DoY/EXxyR 103K0g9n7cCMc51bpRA37XUMowXZ8aGN8CQz6YQLlF5FNyWZ3AudfJ0q/ywdTWrYn6nyYP+aP5fBQ t/b3jjULI5YbCM9Kccz7Lg2Yj/J4OQfaHNq+AILPjZQ9OgZbn6d0ICartwJKnpRsMe0w=; Received: from forward103a.mail.yandex.net ([178.154.239.86]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1w8QHi-0000hs-Ll for openvpn-devel@lists.sourceforge.net; Thu, 02 Apr 2026 22:13:07 +0000 Received: from mail-nwsmtp-smtp-production-main-54.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-54.vla.yp-c.yandex.net [IPv6:2a02:6b8:c17:2010:0:640:2180:0]) by forward103a.mail.yandex.net (Yandex) with ESMTPS id D2A26804BF for ; Fri, 03 Apr 2026 01:12:54 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-54.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id qClrTu3SMKo0-3xV2DWCH; Fri, 03 Apr 2026 01:12:54 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1775167974; bh=BzqEJV71UMfe4kqC/enPiA/17s889+Y1I+5V/+FZAqo=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=hBC8uux4X8OzAy1ZMd7Ga2AW6ZnFoOsmGQ4U5Z9mpJZmuO8MDvSSCeyrcVUATxxSO qA+SyuQOvwxpEMPq7xaq8JSlWZbm+as7UYddT64ndKRJSKjLNDqRmA/iYS1Nia2Ytm Aiaj6EIiBWUUnGc9AIbW9M5gKKAC4Rtso1A1rlB8= Authentication-Results: mail-nwsmtp-smtp-production-main-54.vla.yp-c.yandex.net; dkim=pass header.i=@ya.ru From: Alexey Slokva To: openvpn-devel@lists.sourceforge.net Date: Fri, 3 Apr 2026 01:09:49 +0300 Message-ID: <20260402221251.16811-2-Alesha72003@ya.ru> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260402221251.16811-1-Alesha72003@ya.ru> References: <20260402221251.16811-1-Alesha72003@ya.ru> MIME-Version: 1.0 X-Spam-Score: 1.1 (+) 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: Recent protobuf versions mark ParseFromString() as [[nodiscard]], which makes ignoring its return value fail the build with stricter warning settings. Check the return value when decoding key_config and raise NetCfgException if parsing fails. Content analysis details: (1.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 RCVD_IN_UCE2 RBL: IP Subnet Listed in UCEPROTECT Level 2 [178.154.239.86 listed in dnsbl-2.uceprotect.net] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [alesha72003(at)ya.ru] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [alesha72003(at)ya.ru] X-Headers-End: 1w8QHi-0000hs-Ll Subject: [Openvpn-devel] [PATCH] netcfg-dco: fix ignoring return value of ParseFromString key_config 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?1861398553774020575?= X-GMAIL-MSGID: =?utf-8?q?1861398553774020575?= Recent protobuf versions mark ParseFromString() as [[nodiscard]], which makes ignoring its return value fail the build with stricter warning settings. Check the return value when decoding key_config and raise NetCfgException if parsing fails. Signed-off-by: Alexey Slokva --- src/netcfg/netcfg-dco.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/netcfg/netcfg-dco.cpp b/src/netcfg/netcfg-dco.cpp index 290c12a8..c39c741f 100644 --- a/src/netcfg/netcfg-dco.cpp +++ b/src/netcfg/netcfg-dco.cpp @@ -265,7 +265,10 @@ void NetCfgDCO::method_new_key(GVariant *params) std::string key_config = glib2::Value::Extract(params, 1); DcoKeyConfig dco_kc; - dco_kc.ParseFromString(base64->decode(key_config)); + if (!dco_kc.ParseFromString(base64->decode(key_config))) + { + throw NetCfgException("ParseFromString for key_config failed"); + } auto copyKeyDirection = [](const DcoKeyConfig_KeyDirection &src, KoRekey::KeyDirection &dst) {