[S] Change in openvpn[master]: openvpnserv: fix log lines format string

"cron2 \(Code Review\) via Openvpn-devel" <[email protected]>
Newsgroups gmane.network.openvpn.devel
Message-ID <[email protected]>
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1861?usp=email )

Change subject: openvpnserv: fix log lines format string
......................................................................

openvpnserv: fix log lines format string

The interface name is UTF-8 encoded. In order to log it correctly,
it needs to be converted to UTF-16 first.

Change-Id: Iec392a47123d618c0dbc3a5241c39da4ac83d880
Signed-off-by: Heiko Hund <[email protected]>
Acked-by: Razvan Cojocaru <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1861
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg38650.html
Signed-off-by: Gert Doering <[email protected]>
---
M src/openvpnserv/interactive.c
1 file changed, 9 insertions(+), 3 deletions(-)




diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index a9e9665..36dfb8e 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -1224,19 +1224,25 @@
     err = InterfaceLuid(itf_name, &luid);
     if (err)
     {
-        MsgToEventLog(M_ERR, L"%S: failed to convert itf alias '%s'", __func__, itf_name);
+        PWSTR wide_name = utf8to16(itf_name);
+        MsgToEventLog(M_ERR, L"%S: failed to convert itf alias '%s'", __func__, wide_name);
+        free(wide_name);
         goto out;
     }
     err = ConvertInterfaceLuidToGuid(&luid, &guid);
     if (err)
     {
-        MsgToEventLog(M_ERR, L"%S: Failed to convert itf '%s' LUID", __func__, itf_name);
+        PWSTR wide_name = utf8to16(itf_name);
+        MsgToEventLog(M_ERR, L"%S: Failed to convert itf '%s' LUID", __func__, wide_name);
+        free(wide_name);
         goto out;
     }
 
     if (StringFromIID(&guid, &iid_str) != S_OK)
     {
-        MsgToEventLog(M_ERR, L"%S: Failed to convert itf '%s' IID", __func__, itf_name);
+        PWSTR wide_name = utf8to16(itf_name);
+        MsgToEventLog(M_ERR, L"%S: Failed to convert itf '%s' IID", __func__, wide_name);
+        free(wide_name);
         err = ERROR_OUTOFMEMORY;
         goto out;
     }

-- 
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1861?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Iec392a47123d618c0dbc3a5241c39da4ac83d880
Gerrit-Change-Number: 1861
Gerrit-PatchSet: 2
Gerrit-Owner: d12fk <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-Reviewer: razvanc <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.