VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-16 02:04:31 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-16 08:04:07 (GMT)
commitce76957a10070c132a8adfbe2e7d3f12395b4caa (patch)
treedf9ede22756dc23ff9e19555ccfba1c3db62cc77 /src/Format
parent1bf219b0dca05edf337b322162169209cd224b6c (diff)
downloadVeraCrypt-ce76957a10070c132a8adfbe2e7d3f12395b4caa.zip
VeraCrypt-ce76957a10070c132a8adfbe2e7d3f12395b4caa.tar.gz
Windows: Fix various issues detected by static analysis.
Diffstat (limited to 'src/Format')
-rw-r--r--src/Format/Tcformat.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index 31140fd..66ec3ac 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;