From patchwork Tue May 20 08:55:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4262 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:a599:b0:662:a395:de2b with SMTP id hj25csp313260mab; Tue, 20 May 2025 01:55:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWmtcTIBRTdWAeXjnCwlW6OkghNVCheWL9hw/pcKD5pXnDxntobHih7xGTwUkAq3LESZz1d2NoOSls=@openvpn.net X-Google-Smtp-Source: AGHT+IE/XhiUdRLys6JgR3sRcZ4m1icdROsM0M0WBL2BKyOdU/8Hav6yowoLs9DlkcFMiR3aQjLG X-Received: by 2002:a05:6602:1d8e:b0:85d:ad56:af88 with SMTP id ca18e2360f4ac-86a173e60e1mr1787037439f.1.1747731326260; Tue, 20 May 2025 01:55:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747731326; cv=none; d=google.com; s=arc-20240605; b=Kq8DHpPpP2TZabCGmQxvJL6THn7YzoUkw4kFah/vA/dfK2BtkxR5UUbNfnyU0O1WIR z60LWrEJkRyKQX1Ue9HVsP/PrwxZUg/oIt3EQsz8QFDNWfPNCwHLeQ3//poh1bxwT+Ly qZTdV+Jc8bvP/qCAx9Ic6T4kS17WLHwM05XWQXxmnbnJi4VZRUq9OJ9dTvTZucL0O40L rIFymXB+T7N149dKaXwmXoJO1nd9eUv8QPuIO6TfAEozprXxJkUBHD/y2I2Sza6/AKH5 736/IY4iMkWVvCzl5OkQP/66HGBd/XKxVnK9ScVX373HdZh3siD9T40INZu1/a64HHnZ fmEQ== 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=sl3X8gmWi/IL+SsvmRSDiJjN8nU2vS+foijDzYmrdr4=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=Z0K2mFwd1B9eLyRawfOgmeBtUMFfz/OSheLLqB8PlZwaTsmwUPxURjjsa87XB1pt+m uCqYQ188lw6sXr2T1CxPNVaVYTsEV5tNW7WTBWCmrkprA8dj9fPJNrrHDzZEOW3Cf4Xy bhsmC97p+bfONWKanIs89nHYShXmwesuUDSXtlkTBWxgAwsS5HH1A24RnvaLB3MeZk0k vP32cPdJyXvAnFE7PLwXNrqx5P/zJAApUJt9JFGTydVpQ8e35lixZqPpukQivxZ5U2CQ 9VTiKf6MjIPNd+m5JKVJZINgUPafawJsHaGShxHqUXufo+iBeECH7fE76HOhiXGddriD ksLQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=kQ6TlLoZ; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=UJ4CTeMh; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=m6DnF19H; 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 8926c6da1cb9f-4fbcc4935a9si6402076173.87.2025.05.20.01.55.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 May 2025 01:55:26 -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=kQ6TlLoZ; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=UJ4CTeMh; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=m6DnF19H; 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=sl3X8gmWi/IL+SsvmRSDiJjN8nU2vS+foijDzYmrdr4=; b=kQ6TlLoZW1xWjZwzF0R78CauiS XWXUpmjukOrJM+F70wpTKnnQcqIf1On84gvYzVj0WToXOLT0RoHLfzLahbYYor4OUTh3Qj1xlWIOG cIA8zhPYb9o0LxhI+OxeKWw90rlhKybXekIvfk0A26bkDeO7sVEB4J4zaxpfwN1hoTKc=; 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 1uHIku-0002zr-6Z; Tue, 20 May 2025 08:55:24 +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 1uHIks-0002zJ-CA for openvpn-devel@lists.sourceforge.net; Tue, 20 May 2025 08:55:22 +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=WPvPzpF7P9NEe3gAkx57g2OUTqECL1bLXEUJ7wkcJgM=; b=UJ4CTeMhhYMK1L7rGAaFiOhKYU yPKH7mJCcsk3UJOEKUMmRR4tP4QRmWWOfkiBOrG3FC7hLK7E7Od5zUr+h0uIy+5EF+sW2tPrVEjdb Q+TxMH8UOnd1ZPpI0HpbuPuFhKKMajNAIOPW0WNitvTBpJ0eDCudcii0H11M/xIKNL7o=; 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=WPvPzpF7P9NEe3gAkx57g2OUTqECL1bLXEUJ7wkcJgM=; b=m6DnF19Hraa83f0j0qMCVnp7M1 4NIVTQD2bEHUOleJeE4QT6dov3wNesqbFQVEsi0SwcoGW4F4ESF/ZbRheiopumPqziNJdgLL+5Km5 AbjRryHZqmmQOFDhwRUidqM/XO+2M+0SHhoZgHAI+yQy9FlbqlFyfAzRsDdG82sFnMNE=; Received: from [193.149.48.143] (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 1uHIkr-0000ml-6k for openvpn-devel@lists.sourceforge.net; Tue, 20 May 2025 08:55:22 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 54K8tEbx028233 for ; Tue, 20 May 2025 10:55:14 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 54K8tE5Q028232 for openvpn-devel@lists.sourceforge.net; Tue, 20 May 2025 10:55:14 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Tue, 20 May 2025 10:55:06 +0200 Message-ID: <20250520085513.28213-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "6901ab67b84d", 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: Heiko Hund The size of the returned MULTI_SZ wide domains string was calculated wrongly. Instead of adding the size of a WCHAR, only the size of a char was used. As a result, the domains string was stored too sh [...] 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: 1uHIkr-0000ml-6k Subject: [Openvpn-devel] [PATCH v3] win: fix collecting DNS exclude data 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?1832629122981135245?= X-GMAIL-MSGID: =?utf-8?q?1832629122981135245?= From: Heiko Hund The size of the returned MULTI_SZ wide domains string was calculated wrongly. Instead of adding the size of a WCHAR, only the size of a char was used. As a result, the domains string was stored too short and was missing the final string terminator. DHCP assigned DNS server addresses are separated by space, not comma. These spaces were not replaced by semicolon, as the spec requires. Fixes: OpenVPN/openvpn#747 Change-Id: Ie3fcd845344fd0c3ce9a2f99612fb19fe5ebb2f1 Signed-off-by: Heiko Hund Acked-by: Lev Stipakov --- 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/+/1028 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Lev Stipakov diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index a1581a6..bea8277 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -2226,7 +2226,7 @@ { /* This was the last domain */ *pos = '\0'; - *size += 1; + *size += one_glyph; return wcslen(domains) ? NO_ERROR : ERROR_FILE_NOT_FOUND; } } @@ -2248,13 +2248,13 @@ memmove(pos + 1, pos, buf_size - converted_size - one_glyph); domains[buf_len - 1] = '\0'; *pos = '.'; - *size += 1; + *size += one_glyph; if (!comma) { /* Conversion is done */ *(pos + domain_len) = '\0'; - *size += 1; + *size += one_glyph; return NO_ERROR; } @@ -2409,10 +2409,10 @@ if (v4_addrs_size || v6_addrs_size) { - /* Replace comma-delimters with semicolons, as required by NRPT */ + /* Replace delimters with semicolons, as required by NRPT */ for (int j = 0; j < sizeof(data[0].addresses) && data[i].addresses[j]; j++) { - if (data[i].addresses[j] == ',') + if (data[i].addresses[j] == ',' || data[i].addresses[j] == ' ') { data[i].addresses[j] = ';'; }