mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-27 13:33:29 +01:00
Correct minor bug in ReadRegistryString function
This commit is contained in:
parent
49f679ca53
commit
1763e8a2ba
@ -104,12 +104,13 @@ char *ReadRegistryString (char *subKey, char *name, char *defaultValue, char *st
|
||||
char value[MAX_PATH*4];
|
||||
DWORD size = sizeof (value);
|
||||
|
||||
str[maxLen-1] = 0;
|
||||
strncpy (str, defaultValue, maxLen-1);
|
||||
|
||||
ZeroMemory (value, sizeof value);
|
||||
if (RegOpenKeyEx (HKEY_CURRENT_USER, subKey,
|
||||
0, KEY_READ, &hkey) == ERROR_SUCCESS)
|
||||
if (RegQueryValueEx (hkey, name, 0, 0, (LPBYTE) &value, &size) == ERROR_SUCCESS)
|
||||
if (RegQueryValueEx (hkey, name, 0, 0, (LPBYTE) value, &size) == ERROR_SUCCESS)
|
||||
strncpy (str, value, maxLen-1);
|
||||
|
||||
RegCloseKey (hkey);
|
||||
|
Loading…
Reference in New Issue
Block a user