From: Razvan Cojocaru <[email protected]>
GetRegString() passed default_value, which is built from the install
path, as the swprintf() format, so a '%' in the path was interpreted
as a conversion. Print it with "%ls" and treat only a negative
return as failure.
Format string use introduced in b1263b06 ("Ensure strings read from
registry are null-terminated").
Change-Id: Ib53e82554712d881b1e24f6f3a2f8fbb702951bd
Signed-off-by: Razvan Cojocaru <[email protected]>
Acked-by: Heiko Hund <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2110
---
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/+/2110
This mail reflects revision 1 of this Change.
Acked-by according to Gerrit (reflected above):
Heiko Hund <[email protected]>
diff --git a/src/openvpnserv/common.c b/src/openvpnserv/common.c
index 7a23d41..671ddde 100644
--- a/src/openvpnserv/common.c
+++ b/src/openvpnserv/common.c
@@ -38,7 +38,7 @@
if (status == ERROR_FILE_NOT_FOUND && default_value)
{
size_t len = size / sizeof(data[0]);
- if (swprintf(data, len, default_value))
+ if (swprintf(data, len, L"%ls", default_value) >= 0)
{
status = ERROR_SUCCESS;
}
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel