VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Format.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-06-11 17:26:42 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-06-11 17:28:22 +0200
commitce2aa639f448e4585e953fd14292dc0a9c5c4d86 (patch)
tree4a7433e75e0f9155ac1b2d9e7c753512064c76e8 /src/Common/Format.c
parent70d083bfb2c5dfb5537c5803aef5c8627c8cb551 (diff)
downloadVeraCrypt-ce2aa639f448e4585e953fd14292dc0a9c5c4d86.tar.gz
VeraCrypt-ce2aa639f448e4585e953fd14292dc0a9c5c4d86.zip
Windows: various fixes following Coverity analysis.
Diffstat (limited to 'src/Common/Format.c')
-rw-r--r--src/Common/Format.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Common/Format.c b/src/Common/Format.c
index a7445a9d..cd211db7 100644
--- a/src/Common/Format.c
+++ b/src/Common/Format.c
@@ -163,11 +163,12 @@ int TCFormatVolume (volatile FORMAT_VOL_PARAMETERS *volParams)
FormatSectorSize,
FALSE);
- if (nStatus != 0)
+ /* cryptoInfo sanity check to make Coverity happy eventhough it can't be NULL if nStatus = 0 */
+ if ((nStatus != 0) || !cryptoInfo)
{
burn (header, sizeof (header));
VirtualUnlock (header, sizeof (header));
- return nStatus;
+ return nStatus? nStatus : ERR_OUTOFMEMORY;
}
begin_format: