VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-01-18 15:37:39 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-03-21 19:59:26 (GMT)
commitddaa8ae47a58317cf677a62c4beef62279d4a4da (patch)
tree345ace188593823f11a54450970db5d7d373762e
parente4325a04fd9b105991be2293fb28ca0f01fb4328 (diff)
downloadVeraCrypt-DCS-ddaa8ae47a58317cf677a62c4beef62279d4a4da.zip
VeraCrypt-DCS-ddaa8ae47a58317cf677a62c4beef62279d4a4da.tar.gz
Fix bug in file copy operation by deleting destination file first if it already exists
-rw-r--r--Library/CommonLib/EfiFile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Library/CommonLib/EfiFile.c b/Library/CommonLib/EfiFile.c
index 4839eae..8a9d6d7 100644
--- a/Library/CommonLib/EfiFile.c
+++ b/Library/CommonLib/EfiFile.c
@@ -378,7 +378,8 @@ FileCopy(
res = EFI_BUFFER_TOO_SMALL;
goto copyerr;
}
-
+
+ FileDelete (dstroot, dst);
res = FileOpen(dstroot, dst, &dstfile, EFI_FILE_MODE_CREATE | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_READ, 0);
if (EFI_ERROR(res)) goto copyerr;