| Message ID | 20260304164928.15819-1-gert@greenie.muc.de |
|---|---|
| State | New |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
Delivered-To: patchwork@openvpn.net
Received: by 2002:a05:7001:a68f:b0:83c:d90d:321 with SMTP id wf15csp342598mab;
Wed, 4 Mar 2026 08:49:41 -0800 (PST)
X-Forwarded-Encrypted: i=2;
AJvYcCUaMUPx/wlrJUFmhX2sWOFYq0QNtjubZ/9iHDtQNSPwjDn2ti8DmRWQ2B+nXFLRGFP7IsU49P/0kuQ=@openvpn.net
X-Received: by 2002:a05:6808:3094:b0:450:b249:71bb with SMTP id
5614622812f47-4650c7a1948mr2959371b6e.19.1772642981046;
Wed, 04 Mar 2026 08:49:41 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1772642981; cv=none;
d=google.com; s=arc-20240605;
b=U2+zwoF+TmQam5ZR7+Y6IOp2fO28MzPV3EJou8QZ4fwENJ0xP0VWIFuRA1T614wDeQ
64i+244Mm2ePROaaN84IknEVwqlxSu/L1Mj2Q4a8w6XHggZztB8FHyCJqDooj8+gS3kD
PtjriNmEKKrWY+JoEZfCJFBVoHz6LtKnA8+vEM84TFI1kHf7PwtbtYq4nY59dmZV81Ri
1c9CXkdZZpfXlwHjpBnPlhbyb8VR0tAPBlZuAxlIuAD3dvewi5LC+d4QCpQ7lCCMkvlK
9Hn40vFQsb2BmFnINbh3lk5unA1eJWGydY/lslfEowReogfh/ZIxEchk0zNoYYCQIUSJ
vqcA==
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=aiCw3MKJH/u2vOJYj/HD2G8VLAeIYVcK1hlDqecneBA=;
fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=;
b=JGe2sNm0Q9i/7gTLK0XC4BiPD/uWwrkuRUEo6sSjqMCenTDgd07rANmrEx96LBIskt
5/WH9muntllsw1qsIG9T7RkHA74i+IZXHByrwkKhMNy30mNj3PlI9ee86BJum7fiagO8
i+ACLZu93AgS9soq4Lq3EMdpmQt9DmMnCrHSjB7ZeZSrbJw76fZrKImecWrBzTFCB/z/
2rMSDZ4FT+amNNAz/qq2Z7Mn3s7nJa8Mu96HN/PGMojGCwEtUm0Tj60oWkebDDRwpJLe
2UaLoKciduNJenffUNJGRuAlqKxTtouuMNgomjr0ws2sED4b1rmTf/Ww5II1WC2c+KXE
TcOw==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=anCgilTd;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=G6oHCKqQ;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=ZxUK93N1;
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-4160d2cc338si14524095fac.279.2026.03.04.08.49.40
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Wed, 04 Mar 2026 08:49:41 -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=anCgilTd;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=G6oHCKqQ;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=ZxUK93N1;
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=aiCw3MKJH/u2vOJYj/HD2G8VLAeIYVcK1hlDqecneBA=; b=anCgilTd1S6xgSPH6rmG9bG7h3
JakKIwmhualDb2dugbfwJY22i8AoULvL4Az+j5IULQbvyRIl/uzm/+SDKW3M77t/OdcZcmmP9jvAj
EokcxFs5lAgL7DuKsvwuS8wRXYMaAdBcnunIV3U+vklNX4NXFywU04LM7DlaA1QzvSak=;
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.95)
(envelope-from <openvpn-devel-bounces@lists.sourceforge.net>)
id 1vxpPl-0001tP-Or;
Wed, 04 Mar 2026 16:49:37 +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.95)
(envelope-from <gert@blue4.greenie.muc.de>) id 1vxpPk-0001tH-KI
for openvpn-devel@lists.sourceforge.net;
Wed, 04 Mar 2026 16:49:36 +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=vRacsnnQtfVzgTXYtNxEHwvA326Rdj4Yu8s1vTb6620=; b=G6oHCKqQ2RVxYFcN2luapKmm/u
PT7OCAdTr/tNfzVPqlGr5be5XF+jB/eS0DjVGSxj6dfIe0NTKljlh+syPGegw+QeBnaHes6R3Pmt7
qgkGJVbg/8Hw/cRn7wvrswXy+AOV7rw+BVK4VVJasKcFKkS/yw/NJDIwqgZxt2Srbaus=;
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=vRacsnnQtfVzgTXYtNxEHwvA326Rdj4Yu8s1vTb6620=; b=ZxUK93N1DUrPHBs60qYjXTj8Vz
2odCd2BsVU7vZfW2iyfJyOxZg2YM4FNKEXf5eHJDDOx3i8IEH3XZYJb2tZNf7wbihmAn0KtgD6TAe
IyUTYKT88rI/PoX8Nn7v18s9kl+N8B+cjU8zBVQT1i1lLKEtvn3Q+8SfWLKUngrxHjVY=;
Received: from [193.149.48.129] (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 1vxpPj-0003Si-LZ for openvpn-devel@lists.sourceforge.net;
Wed, 04 Mar 2026 16:49:36 +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 624GnTMM015840
for <openvpn-devel@lists.sourceforge.net>; Wed, 4 Mar 2026 17:49:29 +0100
Received: (from gert@localhost)
by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 624GnTJJ015839
for openvpn-devel@lists.sourceforge.net; Wed, 4 Mar 2026 17:49:29 +0100
From: Gert Doering <gert@greenie.muc.de>
To: openvpn-devel@lists.sourceforge.net
Date: Wed, 4 Mar 2026 17:49:22 +0100
Message-ID: <20260304164928.15819-1-gert@greenie.muc.de>
X-Mailer: git-send-email 2.52.0
In-Reply-To:
<gerrit.1769513463000.I4ff7983a33426fda9a138fe6e56a1c03522836d3@gerrit.openvpn.net>
References:
<gerrit.1769513463000.I4ff7983a33426fda9a138fe6e56a1c03522836d3@gerrit.openvpn.net>
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 <frank@lichtenheld.com> Handle the
case where the return value is zero and avoid sign-compare warning.
Change-Id:
I4ff7983a33426fda9a138fe6e56a1c03522836d3 Signed-off-by: Frank Lichtenheld
<frank@lichtenheld.com> Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c [...]
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: 1vxpPj-0003Si-LZ
Subject: [Openvpn-devel] [PATCH v5] win32-util: Handle return value from
WideCharToMultiByte better
X-BeenThere: openvpn-devel@lists.sourceforge.net
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: openvpn-devel-bounces@lists.sourceforge.net
X-getmail-retrieved-from-mailbox: Inbox
X-GMAIL-THRID: =?utf-8?q?1858750886490392594?=
X-GMAIL-MSGID: =?utf-8?q?1858750886490392594?=
|
| Series |
[Openvpn-devel,v5] win32-util: Handle return value from WideCharToMultiByte better
|
|
Commit Message
Gert Doering
March 4, 2026, 4:49 p.m. UTC
From: Frank Lichtenheld <frank@lichtenheld.com> Handle the case where the return value is zero and avoid sign-compare warning. Change-Id: I4ff7983a33426fda9a138fe6e56a1c03522836d3 Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1495 --- 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/+/1495 This mail reflects revision 5 of this Change. Acked-by according to Gerrit (reflected above): Arne Schwabe <arne-openvpn@rfc2549.org>
Comments
Makes sense, appeases the compiler, increases readability *and* has
an ACK from Arne (plus green BB) ;-)
Your patch has been applied to the master branch.
commit 71c6729c403a17492a68ce70b0f6fd17c07e3de0
Author: Frank Lichtenheld
Date: Wed Mar 4 17:49:22 2026 +0100
win32-util: Handle return value from WideCharToMultiByte better
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1495
Message-Id: <20260304164928.15819-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35906.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
diff --git a/src/openvpn/win32-util.c b/src/openvpn/win32-util.c index e60cbac..6fc3be4 100644 --- a/src/openvpn/win32-util.c +++ b/src/openvpn/win32-util.c @@ -146,11 +146,6 @@ return true; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - const char * win_get_tempdir(void) { @@ -162,7 +157,14 @@ return NULL; } - if (WideCharToMultiByte(CP_UTF8, 0, wtmpdir, -1, NULL, 0, NULL, NULL) > sizeof(tmpdir)) + int ret = WideCharToMultiByte(CP_UTF8, 0, wtmpdir, -1, NULL, 0, NULL, NULL); + /* According to documentation ret is never < 0, but include it here just in case */ + if (ret <= 0) + { + msg(M_WARN | M_ERRNO, "Conversion of path name failed."); + return NULL; + } + if ((unsigned int)ret > sizeof(tmpdir)) { msg(M_WARN, "Could not get temporary directory. Path is too long." " Consider using --tmp-dir"); @@ -173,7 +175,4 @@ return tmpdir; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif #endif /* _WIN32 */