diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-08-16 04:04:31 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-08-16 10:04:07 +0200 |
commit | ce76957a10070c132a8adfbe2e7d3f12395b4caa (patch) | |
tree | df9ede22756dc23ff9e19555ccfba1c3db62cc77 /src/Format | |
parent | 1bf219b0dca05edf337b322162169209cd224b6c (diff) | |
download | VeraCrypt-ce76957a10070c132a8adfbe2e7d3f12395b4caa.tar.gz VeraCrypt-ce76957a10070c132a8adfbe2e7d3f12395b4caa.zip |
Windows: Fix various issues detected by static analysis.
Diffstat (limited to 'src/Format')
-rw-r--r-- | src/Format/Tcformat.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index 31140fd7..66ec3ac3 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -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; |