VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Random.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-02-07 01:07:38 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-02-07 01:39:43 (GMT)
commitae7ec4802a81770ff164e465b8d1fb51624ca093 (patch)
tree369c0ddf810ea03ae2d1426a661b54ca5288c34c /src/Common/Random.c
parent229bd668f414cac163d12be9a3284b79d95b4ac0 (diff)
downloadVeraCrypt-ae7ec4802a81770ff164e465b8d1fb51624ca093.zip
VeraCrypt-ae7ec4802a81770ff164e465b8d1fb51624ca093.tar.gz
Windows:Fix various issues and warnings reported by static code analysis tool Coverity.
Diffstat (limited to 'src/Common/Random.c')
-rw-r--r--src/Common/Random.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Common/Random.c b/src/Common/Random.c
index 31dea51..21c18da 100644
--- a/src/Common/Random.c
+++ b/src/Common/Random.c
@@ -671,10 +671,10 @@ BOOL SlowPoll (void)
wchar_t dllPath[MAX_PATH];
if (GetSystemDirectory (dllPath, MAX_PATH))
{
- StringCbCatW(dllPath, sizeof(dllPath), L"\\NETAPI32.DLL");
+ StringCchCatW(dllPath, ARRAYSIZE(dllPath), L"\\NETAPI32.DLL");
}
else
- StringCbCopyW(dllPath, sizeof(dllPath), L"C:\\Windows\\System32\\NETAPI32.DLL");
+ StringCchCopyW(dllPath, ARRAYSIZE(dllPath), L"C:\\Windows\\System32\\NETAPI32.DLL");
hNetAPI32 = LoadLibrary (dllPath);
if (hNetAPI32 != NULL)
@@ -725,7 +725,7 @@ BOOL SlowPoll (void)
wchar_t szDevice[24];
/* Check whether we can access this device */
- StringCbPrintfW (szDevice, sizeof(szDevice), L"\\\\.\\PhysicalDrive%d", nDrive);
+ StringCchPrintfW (szDevice, ARRAYSIZE(szDevice), L"\\\\.\\PhysicalDrive%d", nDrive);
hDevice = CreateFile (szDevice, 0, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, 0, NULL);
if (hDevice == INVALID_HANDLE_VALUE)