VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-05-31 21:40:42 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-11-08 22:19:08 (GMT)
commit1763e8a2ba64517fece9f10f1a0011f31975318f (patch)
tree0fc08e14cd6718467f62c76c239694c125189830 /src
parent49f679ca53cc960875b79a38ec79c230ccaab6a7 (diff)
downloadVeraCrypt-1763e8a2ba64517fece9f10f1a0011f31975318f.zip
VeraCrypt-1763e8a2ba64517fece9f10f1a0011f31975318f.tar.gz
Correct minor bug in ReadRegistryString function
Diffstat (limited to 'src')
-rw-r--r--src/Common/Registry.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Common/Registry.c b/src/Common/Registry.c
index 0c5d51b..c749647 100644
--- a/src/Common/Registry.c
+++ b/src/Common/Registry.c
@@ -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);