VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Format/Tcformat.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-02-08 22:46:04 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-02-09 10:01:21 (GMT)
commitd5f34ad49d345803767d4a1166d764f9f8485541 (patch)
treea101ab51e55dffdbcdef4c15596fd9418df421cd /src/Format/Tcformat.c
parent608e86c7bc962f369003d9d05d4402f9da273f0c (diff)
downloadVeraCrypt-d5f34ad49d345803767d4a1166d764f9f8485541.zip
VeraCrypt-d5f34ad49d345803767d4a1166d764f9f8485541.tar.gz
Static Code Analysis: Avoid over-flaw in arithmetic operations by adding more checks. Add extra checks. Solve various issues.
Diffstat (limited to 'src/Format/Tcformat.c')
-rw-r--r--src/Format/Tcformat.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c
index 4984e6c..995222d 100644
--- a/src/Format/Tcformat.c
+++ b/src/Format/Tcformat.c
@@ -2537,13 +2537,12 @@ static void __cdecl volTransformThreadFunction (void *hwndDlgArg)
if (!bInPlaceEncNonSys)
SetTimer (hwndDlg, TIMER_ID_RANDVIEW, TIMER_INTERVAL_RANDVIEW, NULL);
- if (volParams != NULL)
- {
- burn ((LPVOID) volParams, sizeof(FORMAT_VOL_PARAMETERS));
- VirtualUnlock ((LPVOID) volParams, sizeof(FORMAT_VOL_PARAMETERS));
- free ((LPVOID) volParams);
- volParams = NULL;
- }
+
+ // volParams is ensured to be non NULL at this stage
+ burn ((LPVOID) volParams, sizeof(FORMAT_VOL_PARAMETERS));
+ VirtualUnlock ((LPVOID) volParams, sizeof(FORMAT_VOL_PARAMETERS));
+ free ((LPVOID) volParams);
+ volParams = NULL;
bVolTransformThreadRunning = FALSE;
bVolTransformThreadCancel = FALSE;
@@ -9027,6 +9026,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, char *lpszComm
DialogBoxParamW (hInstance, MAKEINTRESOURCEW (IDD_VOL_CREATION_WIZARD_DLG), NULL, (DLGPROC) MainDialogProc,
(LPARAM)lpszCommandLine);
+ FinalizeApp ();
return 0;
}