VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Dlgcode.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-08-24 01:31:30 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-08-27 02:18:40 +0200
commitad3b8eca694ed4d7a0ff17f955736725aad0cea6 (patch)
tree1faaca5e08fdd89b7304b2ceec00366e4fb70564 /src/Common/Dlgcode.c
parent20cb199e55f2f29316a24ff5723c2f8e3b0f4a98 (diff)
downloadVeraCrypt-ad3b8eca694ed4d7a0ff17f955736725aad0cea6.tar.gz
VeraCrypt-ad3b8eca694ed4d7a0ff17f955736725aad0cea6.zip
Windows: Protect against using a container file as its own keyfile. Normalizing path names to never use '/' but always '\'.
Diffstat (limited to 'src/Common/Dlgcode.c')
-rw-r--r--src/Common/Dlgcode.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index abad5e70..ead50a73 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -6184,6 +6184,16 @@ BOOL CheckFileExtension (char *fileName)
return FALSE;
}
+void CorrectFileName (char* fileName)
+{
+ /* replace '/' by '\' */
+ size_t i, len = strlen (fileName);
+ for (i = 0; i < len; i++)
+ {
+ if (fileName [i] == '/')
+ fileName [i] = '\\';
+ }
+}
void IncreaseWrongPwdRetryCount (int count)
{