]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Format Windows error message in Unicode
authorSelva Nair <selva.nair@gmail.com>
Tue, 18 Apr 2023 14:14:46 +0000 (10:14 -0400)
committerGert Doering <gert@greenie.muc.de>
Thu, 4 May 2023 14:01:49 +0000 (16:01 +0200)
commitfed67642dccbcf115952df0709a98929c1fc52b8
tree39fa2c3f60893adcada437b94b20b143a3e43df7
parent7b21c69dbe1e1ecfb5bed564417387892b42108a
Format Windows error message in Unicode

- We assume that all text passed to the management interface
  and written to log file are in Unicode (UTF-8). This is broken by
  the use of the ANSI version of FormatMessage() for Windows error
  messages. Fix by using FormatMessageW() and converting the UTF-16
  result to UTF-8.

v2: assign return value of FormatMessageW() to DWORD, not int

Github: fixes OpenVPN/openvpn#319

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20230418141446.1755363-1-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26598.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/error.c