mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
Windows: avoid leaking location of selected keyfiles by clearing global variable used to store multiple file selection path.
This commit is contained in:
@@ -4160,6 +4160,7 @@ BOOL SelectMultipleFiles (HWND hwndDlg, const char *stringId, wchar_t *lpszFileN
|
|||||||
|
|
||||||
ZeroMemory (&ofn, sizeof (ofn));
|
ZeroMemory (&ofn, sizeof (ofn));
|
||||||
|
|
||||||
|
SelectMultipleFilesPath[0] = 0;
|
||||||
*lpszFileName = 0;
|
*lpszFileName = 0;
|
||||||
ofn.lStructSize = sizeof (ofn);
|
ofn.lStructSize = sizeof (ofn);
|
||||||
ofn.hwndOwner = hwndDlg;
|
ofn.hwndOwner = hwndDlg;
|
||||||
@@ -4192,6 +4193,7 @@ BOOL SelectMultipleFiles (HWND hwndDlg, const char *stringId, wchar_t *lpszFileN
|
|||||||
// Single file selected
|
// Single file selected
|
||||||
StringCbCopyW (lpszFileName, cbFileName, SelectMultipleFilesPath);
|
StringCbCopyW (lpszFileName, cbFileName, SelectMultipleFilesPath);
|
||||||
SelectMultipleFilesOffset = 0;
|
SelectMultipleFilesOffset = 0;
|
||||||
|
SecureZeroMemory (SelectMultipleFilesPath, sizeof (SelectMultipleFilesPath));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -4229,7 +4231,10 @@ BOOL SelectMultipleFilesNext (wchar_t *lpszFileName, size_t cbFileName)
|
|||||||
|
|
||||||
SelectMultipleFilesOffset += (int) wcslen (SelectMultipleFilesPath + SelectMultipleFilesOffset) + 1;
|
SelectMultipleFilesOffset += (int) wcslen (SelectMultipleFilesPath + SelectMultipleFilesOffset) + 1;
|
||||||
if (SelectMultipleFilesPath[SelectMultipleFilesOffset] == 0)
|
if (SelectMultipleFilesPath[SelectMultipleFilesOffset] == 0)
|
||||||
|
{
|
||||||
SelectMultipleFilesOffset = 0;
|
SelectMultipleFilesOffset = 0;
|
||||||
|
SecureZeroMemory (SelectMultipleFilesPath, sizeof (SelectMultipleFilesPath));
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user