diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-01-17 10:49:03 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-01-17 10:52:31 +0100 |
commit | 3cda204626decc728b6bc0c74ccc25fd94e631d9 (patch) | |
tree | 3a5a075caf0697720910124f094c0ca87568275f | |
parent | 59afc2c4d9704476bdaf8c4c8b45684a80781a06 (diff) | |
download | VeraCrypt-3cda204626decc728b6bc0c74ccc25fd94e631d9.tar.gz VeraCrypt-3cda204626decc728b6bc0c74ccc25fd94e631d9.zip |
Windows: avoid leaking location of selected keyfiles by clearing global variable used to store multiple file selection path.
-rw-r--r-- | src/Common/Dlgcode.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index c74b9ef7..8b1ed218 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -4160,6 +4160,7 @@ BOOL SelectMultipleFiles (HWND hwndDlg, const char *stringId, wchar_t *lpszFileN ZeroMemory (&ofn, sizeof (ofn));
+ SelectMultipleFilesPath[0] = 0;
*lpszFileName = 0;
ofn.lStructSize = sizeof (ofn);
ofn.hwndOwner = hwndDlg;
@@ -4192,6 +4193,7 @@ BOOL SelectMultipleFiles (HWND hwndDlg, const char *stringId, wchar_t *lpszFileN // Single file selected
StringCbCopyW (lpszFileName, cbFileName, SelectMultipleFilesPath);
SelectMultipleFilesOffset = 0;
+ SecureZeroMemory (SelectMultipleFilesPath, sizeof (SelectMultipleFilesPath));
}
else
{
@@ -4229,7 +4231,10 @@ BOOL SelectMultipleFilesNext (wchar_t *lpszFileName, size_t cbFileName) SelectMultipleFilesOffset += (int) wcslen (SelectMultipleFilesPath + SelectMultipleFilesOffset) + 1;
if (SelectMultipleFilesPath[SelectMultipleFilesOffset] == 0)
+ {
SelectMultipleFilesOffset = 0;
+ SecureZeroMemory (SelectMultipleFilesPath, sizeof (SelectMultipleFilesPath));
+ }
return TRUE;
}
|