Gert Doering has uploaded a new patch set (#2) to the change originally created 
by Heiko Hund. ( https://gerrit.openvpn.net/c/openvpn/+/2038?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by Frank Lichtenheld


Change subject: win32: pass the buffer size in bytes to get_openvpn_reg_value()
......................................................................

win32: pass the buffer size in bytes to get_openvpn_reg_value()

get_openvpn_reg_value() expects the size of the value buffer in bytes,
as documented and as RegGetValueW() expects it. All callers passed the
number of characters instead, so only half of the buffer was used.

Pass sizeof() of the buffers instead of _countof().

Change-Id: Ifa4497963989c2d6ba68d75942d368c112ac6f67
Signed-off-by: Heiko Hund <[email protected]>
Acked-by: Frank Lichtenheld <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2038
Message-Id: <[email protected]>
URL: 
https://www.mail-archive.com/[email protected]/msg40198.html
Signed-off-by: Gert Doering <[email protected]>
---
M src/openvpn/win32.c
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/38/2038/2

diff --git a/src/openvpn/win32.c b/src/openvpn/win32.c
index fde6412..3af58ed 100644
--- a/src/openvpn/win32.c
+++ b/src/openvpn/win32.c
@@ -1491,7 +1491,7 @@
 set_openssl_env_vars(void)
 {
     WCHAR install_path[MAX_PATH] = { 0 };
-    if (!get_openvpn_reg_value(NULL, install_path, _countof(install_path)))
+    if (!get_openvpn_reg_value(NULL, install_path, sizeof(install_path)))
     {
         const WCHAR *ssl_fallback_dir = L"C:\\Windows\\System32";
         /* if we cannot find installation path from the registry,
@@ -1585,8 +1585,8 @@

     /* Attempt to retrieve the trusted plugin directory path from the registry,
      * using installation path as a fallback */
-    if (!get_openvpn_reg_value(L"plugin_dir", plugin_dir, _countof(plugin_dir))
-        && !get_openvpn_reg_value(NULL, plugin_dir, _countof(plugin_dir)))
+    if (!get_openvpn_reg_value(L"plugin_dir", plugin_dir, sizeof(plugin_dir))
+        && !get_openvpn_reg_value(NULL, plugin_dir, sizeof(plugin_dir)))
     {
         msg(M_WARN, "Installation path could not be determined.");
     }

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

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ifa4497963989c2d6ba68d75942d368c112ac6f67
Gerrit-Change-Number: 2038
Gerrit-PatchSet: 2
Gerrit-Owner: Heiko Hund <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Frank Lichtenheld <[email protected]>
Gerrit-Reviewer: Lev Stipakov <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to