Attention is currently required from: Arne Schwabe.
Hello Arne Schwabe,
I'd like you to do a code review.
Please visit
https://gerrit.openvpn.net/c/openvpn/+/2038?usp=email
to review the following change.
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]>
---
M src/openvpn/win32.c
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/38/2038/1
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: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ifa4497963989c2d6ba68d75942d368c112ac6f67
Gerrit-Change-Number: 2038
Gerrit-PatchSet: 1
Gerrit-Owner: Heiko Hund <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel