VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Password.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2021-07-13 21:59:48 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2021-07-13 22:08:02 +0200
commitc3747824367dbcbe74777c166b6d5d41d6de5dce (patch)
treef081557b6fd3fd5d572682f8397fad03fdfb148e /src/Common/Password.c
parentdce6d76b811f736e224550b22421ec1b963d5bd4 (diff)
downloadVeraCrypt-c3747824367dbcbe74777c166b6d5d41d6de5dce.tar.gz
VeraCrypt-c3747824367dbcbe74777c166b6d5d41d6de5dce.zip
Windows: replace insecure wcscpy/wcscat/strcpy runtime functions with secure equivalents
This fixed failure to build driver for ARM64 with latest VS 2019
Diffstat (limited to 'src/Common/Password.c')
-rw-r--r--src/Common/Password.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Common/Password.c b/src/Common/Password.c
index f2413b6d..4caf3a21 100644
--- a/src/Common/Password.c
+++ b/src/Common/Password.c
@@ -23,6 +23,7 @@
#include "Random.h"
#include <io.h>
+#include <strsafe.h>
#ifndef SRC_POS
#define SRC_POS (__FUNCTION__ ":" TC_TO_STRING(__LINE__))
@@ -210,7 +211,7 @@ int ChangePwd (const wchar_t *lpszVolume, Password *oldPassword, int old_pkcs5,
if (bDevice == FALSE)
{
- wcscpy (szCFDevice, szDiskFile);
+ StringCchCopyW (szCFDevice, ARRAYSIZE(szCFDevice), szDiskFile);
}
else
{