diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-08-24 01:31:30 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-08-27 02:18:40 +0200 |
commit | ad3b8eca694ed4d7a0ff17f955736725aad0cea6 (patch) | |
tree | 1faaca5e08fdd89b7304b2ceec00366e4fb70564 /src/Common/Dlgcode.c | |
parent | 20cb199e55f2f29316a24ff5723c2f8e3b0f4a98 (diff) | |
download | VeraCrypt-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.c | 10 |
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)
{
|