VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/Library/DcsCfgLib
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-09-26 07:42:24 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-10-17 18:17:47 +0200
commit224b1cc286122b8aca5002fec31ed0390b299403 (patch)
tree589a728a9a554361df23389350802d8871ec16f3 /Library/DcsCfgLib
parent5fb01149ef1cecc36b261094b304ff0654bb7ae3 (diff)
downloadVeraCrypt-DCS-224b1cc286122b8aca5002fec31ed0390b299403.tar.gz
VeraCrypt-DCS-224b1cc286122b8aca5002fec31ed0390b299403.zip
Fix various issues reported by Coverity
Diffstat (limited to 'Library/DcsCfgLib')
-rw-r--r--Library/DcsCfgLib/GptEdit.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Library/DcsCfgLib/GptEdit.c b/Library/DcsCfgLib/GptEdit.c
index 702ce5d..f814975 100644
--- a/Library/DcsCfgLib/GptEdit.c
+++ b/Library/DcsCfgLib/GptEdit.c
@@ -143,7 +143,7 @@ GptCheckEntryArray(
UINT32 Crc;
UINTN Size;
- Size = PartHeader->NumberOfPartitionEntries * PartHeader->SizeOfPartitionEntry;
+ Size = (UINTN) PartHeader->NumberOfPartitionEntries * (UINTN) PartHeader->SizeOfPartitionEntry;
Status = gBS->CalculateCrc32(Entrys, Size, &Crc);
if (EFI_ERROR(Status)) {
return EFI_CRC_ERROR;
@@ -162,7 +162,7 @@ GptUpdateCRC(
UINT32 Crc;
UINTN Size;
- Size = PartHeader->NumberOfPartitionEntries * PartHeader->SizeOfPartitionEntry;
+ Size = (UINTN) PartHeader->NumberOfPartitionEntries * (UINTN) PartHeader->SizeOfPartitionEntry;
Status = gBS->CalculateCrc32(Entrys, Size, &Crc);
if (EFI_ERROR(Status)) {
return Status;
@@ -489,6 +489,10 @@ DeListSaveToFile() {
}
if (pad > 0) {
res = FileWrite(file, pad512buf, &pad, NULL);
+ if (EFI_ERROR(res)) {
+ ERR_PRINT(L"Write: %r\n", res);
+ goto error;
+ }
}
}
}