From ad3b8eca694ed4d7a0ff17f955736725aad0cea6 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 24 Aug 2015 01:31:30 +0200 Subject: Windows: Protect against using a container file as its own keyfile. Normalizing path names to never use '/' but always '\'. --- src/Common/Dlgcode.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Common/Dlgcode.c') 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) { -- cgit v1.2.3