You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by sk...@apache.org on 2022/12/08 13:14:42 UTC
[netbeans-native-installers] 12/19: [NETBEANS-2523] Installer creates invalid Win Registry value
This is an automated email from the ASF dual-hosted git repository.
skygo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans-native-installers.git
commit d60ca4f0dfe440d1ce6f478d75f32a7ae612fe05
Author: Lars Bruun-Hansen <lb...@apache.org>
AuthorDate: Sat Jan 4 22:35:05 2020 +0100
[NETBEANS-2523] Installer creates invalid Win Registry value
The WindowsRegistry_set32BitValue0() function was incorrectly using
the length of the Registry name (e.g. 'NoModify') as the the length of
value. Since the value we are setting is of type DWORD the length is
indeed always exactly 4 bytes, regardless of OS bitness.
Solution: sizeof(dword) will always return 4, but we might as well
have hard-coded the 4.
---
jnilib/windows/src/jni_WindowsRegistry.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jnilib/windows/src/jni_WindowsRegistry.c b/jnilib/windows/src/jni_WindowsRegistry.c
index 524a166..3608bf0 100644
--- a/jnilib/windows/src/jni_WindowsRegistry.c
+++ b/jnilib/windows/src/jni_WindowsRegistry.c
@@ -430,7 +430,7 @@ JNIEXPORT void JNICALL Java_org_netbeans_installer_utils_system_windows_WindowsR
DWORD dword = (DWORD) jValue;
LPBYTE byteValue = (LPBYTE) &dword;
- if (!setValue(getMode(jMode),getHKEY(jSection), key, name, REG_DWORD, byteValue, sizeof(name), 0)) {
+ if (!setValue(getMode(jMode),getHKEY(jSection), key, name, REG_DWORD, byteValue, sizeof(dword), 0)) {
throwException(jEnv, "Cannot set value");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists