From patchwork Wed Nov 4 12:48:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5594 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:30a9:b0:118:2077:975e with SMTP id f41csp315379laa; Wed, 4 Nov 2026 04:48:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvBzKClF0THc+vLb2cRoy/YvyfRZ5uKHDrXuWtAsgulAPkKHQhq0Kov71GTC1U0i9st8KrjZgGM0FbQU=@openvpn.net X-Received: by 2002:a05:693c:864d:10b0:369:9062:c392 with SMTP id 5a478bee46e88-36a424261c5mr27353044eec.37.1793796533785; Wed, 04 Nov 2026 04:48:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793796533; cv=none; d=google.com; s=arc-20260327; b=O6ENiUqQoRgB0GZLc9Ain2YB8zzEOK9720QCAcf5cyrKXZ61zsE/HVgTkr02ICNLrP pBdy6jom03NPhLn2ylcShOp+1ZSA+3xAl07szUxk917MgSZrtxv8D/c150lLeY7/4+wC JhrVOEVhYCrJLmjx3EnampVXEkk8ifINll6c2i6z02gD2/HE14NDIlGZHx4CU/YBmOeT WwplVnvmdCZMN2bUY7BqbBI1ing8WImJIFLHpW8XPPGT5sgfxgLHjx1XLyAKG+Fcw9PA VYuqjivn1SbjPBuGVjy/X9V5scS0wkHZlx97tDpuG63tIlxCsIJQLikjvG0vCOCI8Z5u tGuA== 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=vFqNpMwQJVwxCF5+FKLyj8l+ehyJtMaHy/2KBMVedgs=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=VFn32WzIYIbwbt7GtGaxX3FPr/pFjQZIS46xBUIBahzRVhJ22KVLeJPrHgNi3dx/NS 1PzjMJsREKxfXZCH/cUoMjJVEHllifckaGa/1lW33oZxIc6R9m/p2COa1q3is/cjgF20 lDMTUIjaSQA9FCqSeUnPk8n7Ji4nKCWDC3p/nAa7jsLAuUif0L5sNUEXJmNcU+CYeFeY mpxmFLHAikoIt3DmdZTbI/m4o8YSHL8tRO4DW7qde6jcA0Wzb+4OdyyHL2XModrDzB8Q vfuB7TaTLtK/iGFx2gYAvrzBQLdhYskKfCBwHW27wXd9jhfPL/yApxeAoCNUKX5y2lJW cAHw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=dbpG2o1k; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="GP+SRD/1"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=NnwxNaJN; 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 5a478bee46e88-36ca395afddsi6514704eec.58.2026.11.04.04.48.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2026 04:48:53 -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=dbpG2o1k; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="GP+SRD/1"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=NnwxNaJN; 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=vFqNpMwQJVwxCF5+FKLyj8l+ehyJtMaHy/2KBMVedgs=; b=dbpG2o1kSxO+jk oooQjJrYzFLM3lCHRMN2LE5jlzhA1y7MJasidK6TO+D/LlDFqtD8nth4GZJaLIN/AkNZXX1KyOvtY MgaW65ZpUiTAGgVM6V4OviskiQQmslFW5Qd+InZJtJJZJKz5BR/P9pbarwm57EhYH9Qk6ppfz5u27 C6I=; 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.100.1) (envelope-from ) id 1xOaQ8-000000006Wn-2K2r; Wed, 04 Nov 2026 12:48:52 +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.100.1) (envelope-from ) id 1xOaQ7-000000006Wf-0nab for openvpn-devel@lists.sourceforge.net; Wed, 04 Nov 2026 12:48:51 +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=tV+S0LbN79DuEFoDdqWXaQqJ7SJTaXutoF1nh8xQZPc=; b=GP+SRD/1nJetpe+FYymbsjYkch 9PElpkiDUfDu2VEP8g5GfRQFiTzSowOiOCIUxpLGiR1+mhyoWsZDjx6616JJlbX94/JMZeQ9HjDtU xJb6OWo5NRbTeFpKW4QFkrgWGgczu0PmECHDgYfJvVBEeK96BzYlUygI5zegQXXnJxkU=; 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=tV+S0LbN79DuEFoDdqWXaQqJ7SJTaXutoF1nh8xQZPc=; b=NnwxNaJN/U3KOkIVSQE8mQu9HR a95Ao6RjwivGvvIJAdjpThc/wOTv3N0lCo6MHjeE6tUn2ASJ4zry/kJRAJSyRb+W/XEK86FjNc0oS 58Q8NxgMasz6fdNmL+RmSROcVD8rQFbbEn3t22y1168D2xi3vPpdD1mCh3IK9MldZkqM=; 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 1xOaQ5-000000000Rr-29w0 for openvpn-devel@lists.sourceforge.net; Wed, 04 Nov 2026 12:48:51 +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 6A4Cmggv018396 for ; Wed, 4 Nov 2026 13:48:43 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6A4Cmgw0018395 for openvpn-devel@lists.sourceforge.net; Wed, 4 Nov 2026 13:48:42 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 4 Nov 2026 13:48:37 +0100 Message-ID: <20261104124842.18381-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: Razvan Cojocaru get_per_adapter_info() and get_interface_info_list() returned the allocated but unfilled buffer when the second GetPerAdapterInfo() or GetInterfaceInfo() call failed, so callers read uninitialized dat [...] 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: 1xOaQ5-000000000Rr-29w0 Subject: [Openvpn-devel] [PATCH v1] tun: return NULL when the second adapter info query fails 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: 1880931994278334867 X-GMAIL-MSGID: 1880931994278334867 From: Razvan Cojocaru get_per_adapter_info() and get_interface_info_list() returned the allocated but unfilled buffer when the second GetPerAdapterInfo() or GetInterfaceInfo() call failed, so callers read uninitialized data. Return NULL, as get_adapter_info_list() already does. All callers check for it. Change-Id: I2d677eeb6ae9186ede2aeb3c2e0c12d25c935fcd Signed-off-by: Razvan Cojocaru Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2127 --- 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/+/2127 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 225d8b1..7637dc0 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -4129,6 +4129,7 @@ { msg(M_INFO, "GetPerAdapterInfo #2 failed (status=%lu) : %s", status, strerror_win32(status, gc)); + pi = NULL; } } } @@ -4158,6 +4159,7 @@ { msg(M_INFO, "GetInterfaceInfo #2 failed (status=%lu) : %s", status, strerror_win32(status, gc)); + ii = NULL; } } return ii;