From patchwork Fri Nov 27 18:12:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5809 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:91c9:10b0:11b:d6c:f273 with SMTP id tl9-n1csp9274445lad; Fri, 27 Nov 2026 10:13:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErGSpsUoo/x1gsCWmK9vw49hY+iKOtJS8TeH7f5Kjf+a9Z8TNutZ1rt73Avm8qqeqA0pgu72YwBKAYc=@openvpn.net X-Received: by 2002:a05:6870:1b86:b0:48f:e0f6:bff2 with SMTP id 586e51a60fabf-4bc85902ca1mr15950193fac.30.1795803187648; Fri, 27 Nov 2026 10:13:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795803187; cv=none; d=google.com; s=arc-20260327; b=WT/obMZwNrP4eeUXbE2mR2Mbq2shV27+QR3sT5QALAd0aHCViYHP/dx8Pay5/x/KDA 410vbpWtd8xVpfGAFqlKRXHpkGJtQK/rL5Vi+M62nxVtyFp2uUq5lUSXV/LTtVTKwE0p 5aFdWdEFqSL9whziOwksD9KoiofnL46EIixqrmqoSQ/XAAGKwo3Jya4sL0dpjrAr7bjC mYx1dxXGirjiNC5ikxUPZBjFtmp96qv2CLwbsvGf/3p5BZB6K9GFHGGqxRSW1Dmtkn/C N26I9LaUiN6N13/juQqB060QYb9Ej0IetFBqTMcjOjl6qT5fkFq9UGd7IDBfVp4GtAaF 8/gg== 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=ALqeMGeQ5gq3ghFFwes7dcTJXA612O42xyMIZcfFJqk=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=Hu673SGOts+o+fTTioV5KWM6EuH0CfsMNZo0CwGph0XCm9jo4S1+PQIwKdSgDMRO2M kuvPcKLAovPgNwEv/L+0MI1xlaSKTSkmIL1ax5t2UKKj1aEFTYDwJj3fWZIk0gkEEMzr M585ucmmzNY9soaWRnl72d4VW+3p7ibExmrLiLIiR36cEcXbh/WH1NrXv6IpCPPOXVjU Hsdgaxtjhl5aIueOY1htSlIVknzWDL7+rDUtpzHjzcGUytjfAWnAJLpw9VkwKZOe5gG4 lLEqiUH+hjKUnT9ui3VJGU5em59joi1Xp3RCG/3ysTa2GJ/uE4jwvXemGkP/wKsHVTj+ kQdQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=MN4YBlR8; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=hf2Ltdd8; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=FOoGafRj; 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 586e51a60fabf-4c7f9346b5fsi18111247fac.287.2026.11.27.10.13.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Nov 2026 10:13:07 -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=MN4YBlR8; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=hf2Ltdd8; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=FOoGafRj; 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=ALqeMGeQ5gq3ghFFwes7dcTJXA612O42xyMIZcfFJqk=; b=MN4YBlR8lIfdxl sOhjd/ELVyklIAYhtOy8ay8rtC6TLAF6P90QwWBj2jJVdAB/uE0OS1nAl0HdSf5CamGeowhXDkJJD b1HVOd+kT2aTGy9QUtkobhAOmT3AFCX8W8x16M8xGzlNraY+U1Q+wkUFLP5pfZOqLt1759RrJAk+W qDM=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.100.1) (envelope-from ) id 1xX0RW-000000007PF-2npJ; Fri, 27 Nov 2026 18:13:06 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xX0RV-000000007P7-0LEt for openvpn-devel@lists.sourceforge.net; Fri, 27 Nov 2026 18:13:05 +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=EQOYnm1eNHn9S5iywNCQW3MQXi5EyNM4XxINyyH9C9w=; b=hf2Ltdd8KM6mYaL8dpvlYMINbS 6aygSMargA7BbyXQezMQIDmCAjMBC9R0/Tnz1Px/FaUl3SiRWMkmFfhtkxwJm/kqj+8zg78D9LN+K 5l1pN2qVneuZie1wGiW+c8TrFu6eWQnoXb0H5rV0ubsJ9dzoJl2Pm+JYHOfufBo+AZWU=; 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=EQOYnm1eNHn9S5iywNCQW3MQXi5EyNM4XxINyyH9C9w=; b=FOoGafRjv33UO1mb4fyvkCfVaN lKnQDw4bKVRDOKcvmUOE6A1eMZ+KWGd78l0kbjZUt6+2/KirAibnT/qt65Bn/GZV7yRHNXUOPLCAN dqSsPxcgUMVBV9Bo59A5Cfw3gtSed305iZFQsgIN63kayxyR6wmL+qMAfXJFggduwLew=; 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 1xX0RS-000000002EC-1Amj for openvpn-devel@lists.sourceforge.net; Fri, 27 Nov 2026 18:13:03 +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 6ARICtcZ025154 for ; Fri, 27 Nov 2026 19:12:55 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6ARICtYW025153 for openvpn-devel@lists.sourceforge.net; Fri, 27 Nov 2026 19:12:55 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 27 Nov 2026 19:12:50 +0100 Message-ID: <20261127181255.25132-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: Razvan Cojocaru If GetAdaptersAddresses() overflowed on both attempts, find_adapters() freed the buffer, then walked and freed it again. Fail instead. Change-Id: Ib7c79652a694313fa398852353bd1719f6ce7634 Signed-off-by: Razvan Cojocaru Acked-by: Frank Lichtenheld 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: 1xX0RS-000000002EC-1Amj Subject: [Openvpn-devel] [PATCH v1] openvpnmsica: don't reuse the freed adapter address list 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: 1883036123039410550 X-GMAIL-MSGID: 1883036123039410550 From: Razvan Cojocaru If GetAdaptersAddresses() overflowed on both attempts, find_adapters() freed the buffer, then walked and freed it again. Fail instead. Change-Id: Ib7c79652a694313fa398852353bd1719f6ce7634 Signed-off-by: Razvan Cojocaru Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2361 --- 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/+/2361 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpnmsica/openvpnmsica.c b/src/openvpnmsica/openvpnmsica.c index d2fd9af..0ae8992 100644 --- a/src/openvpnmsica/openvpnmsica.c +++ b/src/openvpnmsica/openvpnmsica.c @@ -183,6 +183,7 @@ } free(pAdapterAdresses); + pAdapterAdresses = NULL; if (ulResult != ERROR_BUFFER_OVERFLOW) { /* MSDN does not mention GetAdaptersAddresses() to set GetLastError(). @@ -193,6 +194,12 @@ goto cleanup_pAdapterList; } } + if (pAdapterAdresses == NULL) + { + msg(M_NONFATAL, "%s: GetAdaptersAddresses() kept overflowing", __FUNCTION__); + uiResult = ERROR_BUFFER_OVERFLOW; + goto cleanup_pAdapterList; + } /* Count adapters. */ size_t adapter_count = 0;