VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Tcdefs.h
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/Tcdefs.h
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/Tcdefs.h')
-rw-r--r--src/Common/Tcdefs.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Common/Tcdefs.h b/src/Common/Tcdefs.h
index d01ea63b..2113c81c 100644
--- a/src/Common/Tcdefs.h
+++ b/src/Common/Tcdefs.h
@@ -180,10 +180,10 @@ typedef uint64 uint_64t;
typedef CHAR16 wchar_t;
typedef int LONG;
-#define wcscpy StrCpy
+#define StringCchCopyW StrCpyS
#define wcslen StrLen
#define wcscmp StrCmp
-#define wcscat StrCat
+#define StringCchCatW StrCatS
#define memcpy(dest,source,count) CopyMem(dest,source,(UINTN)(count))
#define memset(dest,ch,count) SetMem(dest,(UINTN)(count),(UINT8)(ch))
@@ -195,7 +195,7 @@ typedef int LONG;
#define strchr(str,ch) ScanMem8((VOID *)(str),AsciiStrSize(str),(UINT8)ch)
#define strcmp AsciiStrCmp
#define strncmp(string1,string2,count) (int)(AsciiStrnCmp(string1,string2,(UINTN)(count)))
-#define strcpy(strDest,strSource) AsciiStrCpyS(strDest,MAX_STRING_SIZE,strSource)
+#define StringCchCopyA(strDest,strMaxSize,strSource) AsciiStrCpyS(strDest,strMaxSize,strSource)
#define strncpy(strDest,strSource,count) AsciiStrnCpyS(strDest,MAX_STRING_SIZE,strSource,(UINTN)count)
#define strlen(str) (size_t)(AsciiStrnLenS(str,MAX_STRING_SIZE))
#define strstr AsciiStrStr