1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Windows: Fix various issues detected by static analysis.

This commit is contained in:
Mounir IDRASSI
2016-08-16 04:04:31 +02:00
parent 1bf219b0dc
commit ce76957a10
8 changed files with 37 additions and 30 deletions

View File

@@ -9206,17 +9206,19 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine)
{
wchar_t szTmp [TC_MAX_PATH + 8000] = {0};
GetArgumentValue (lpszCommandLineArgs, &i, nNoCommandLineArgs, szTmp, ARRAYSIZE (szTmp));
if (wcslen (szTmp) < 1)
if ((HAS_ARGUMENT == GetArgumentValue (lpszCommandLineArgs, &i, nNoCommandLineArgs, szTmp, ARRAYSIZE (szTmp)))
&& (wcslen (szTmp) >= 1)
)
{
memset (szFileName, 0, sizeof (szFileName));
StringCbCopyW (szFileName, sizeof (szFileName), szTmp);
DirectNonSysInplaceDecStartMode = TRUE;
}
else
{
// No valid volume path specified as command-line parameter
AbortProcess ("ERR_PARAMETER_INCORRECT");
}
memset (szFileName, 0, sizeof (szFileName));
StringCbCopyW (szFileName, sizeof (szFileName), szTmp);
DirectNonSysInplaceDecStartMode = TRUE;
}
break;