VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-11-27 22:15:44 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-11-28 01:39:48 +0100
commitb233e6776b6113475676d05cec6f5b8f1318d2f5 (patch)
tree24215edfc23db76a59451c481c0b1e8ebc8c6a42
parent14a477026d6c9f3a549ba0dcc07955a8c70becfb (diff)
downloadVeraCrypt-b233e6776b6113475676d05cec6f5b8f1318d2f5.tar.gz
VeraCrypt-b233e6776b6113475676d05cec6f5b8f1318d2f5.zip
Windows: Don't write extra 0x00 byte at the end of DcsProp file when modifying it through UI
-rw-r--r--src/Mount/Mount.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c
index 7f677580..54dc8158 100644
--- a/src/Mount/Mount.c
+++ b/src/Mount/Mount.c
@@ -11732,13 +11732,14 @@ static BOOL CALLBACK BootLoaderPreferencesDlgProc (HWND hwndDlg, UINT msg, WPARA
while (TextEditDialogBox(FALSE, hwndDlg, GetString ("BOOT_LOADER_CONFIGURATION_FILE"), dcsprop) == IDOK)
{
- if (0 == strcmp(dcsprop.c_str(), currentDcsprop.c_str()))
+ const char* dcspropContent = dcsprop.c_str();
+ if (0 == strcmp(dcspropContent, currentDcsprop.c_str()))
{
break;
}
- else if (validateDcsPropXml (dcsprop.c_str()))
+ else if (validateDcsPropXml (dcspropContent))
{
- WriteESPFile (L"\\EFI\\VeraCrypt\\DcsProp", (LPBYTE) dcsprop.c_str(), (DWORD) dcsprop.size(), true);
+ WriteESPFile (L"\\EFI\\VeraCrypt\\DcsProp", (LPBYTE) dcspropContent, (DWORD) strlen (dcspropContent), true);
break;
}
else