VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Volumes.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-02-07 02:07:38 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-02-07 02:39:43 +0100
commitae7ec4802a81770ff164e465b8d1fb51624ca093 (patch)
tree369c0ddf810ea03ae2d1426a661b54ca5288c34c /src/Common/Volumes.c
parent229bd668f414cac163d12be9a3284b79d95b4ac0 (diff)
downloadVeraCrypt-ae7ec4802a81770ff164e465b8d1fb51624ca093.tar.gz
VeraCrypt-ae7ec4802a81770ff164e465b8d1fb51624ca093.zip
Windows:Fix various issues and warnings reported by static code analysis tool Coverity.
Diffstat (limited to 'src/Common/Volumes.c')
-rw-r--r--src/Common/Volumes.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Common/Volumes.c b/src/Common/Volumes.c
index 50fd8765..b7c77e9c 100644
--- a/src/Common/Volumes.c
+++ b/src/Common/Volumes.c
@@ -1022,16 +1022,16 @@ int CreateVolumeHeaderInMemory (HWND hwndDlg, BOOL bBoot, char *header, int ea,
for (i = 0; i < j; i++)
{
wchar_t tmp2[8] = {0};
- StringCbPrintfW (tmp2, sizeof(tmp2), L"%02X", (int) (unsigned char) keyInfo.master_keydata[i + primaryKeyOffset]);
- StringCbCatW (MasterKeyGUIView, sizeof(MasterKeyGUIView), tmp2);
+ StringCchPrintfW (tmp2, ARRAYSIZE(tmp2), L"%02X", (int) (unsigned char) keyInfo.master_keydata[i + primaryKeyOffset]);
+ StringCchCatW (MasterKeyGUIView, ARRAYSIZE(MasterKeyGUIView), tmp2);
}
HeaderKeyGUIView[0] = 0;
for (i = 0; i < NBR_KEY_BYTES_TO_DISPLAY; i++)
{
wchar_t tmp2[8];
- StringCbPrintfW (tmp2, sizeof(tmp2), L"%02X", (int) (unsigned char) dk[primaryKeyOffset + i]);
- StringCbCatW (HeaderKeyGUIView, sizeof(HeaderKeyGUIView), tmp2);
+ StringCchPrintfW (tmp2, ARRAYSIZE(tmp2), L"%02X", (int) (unsigned char) dk[primaryKeyOffset + i]);
+ StringCchCatW (HeaderKeyGUIView, ARRAYSIZE(HeaderKeyGUIView), tmp2);
}
if (dots3)