1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 02:58:02 -06:00

Windows: Don't write extra 0x00 byte at the end of DcsProp file when modifying it through UI

This commit is contained in:
Mounir IDRASSI
2019-11-27 22:15:44 +01:00
parent 14a477026d
commit b233e6776b

View File

@@ -11732,13 +11732,14 @@ static BOOL CALLBACK BootLoaderPreferencesDlgProc (HWND hwndDlg, UINT msg, WPARA
while (TextEditDialogBox(FALSE, hwndDlg, GetString ("BOOT_LOADER_CONFIGURATION_FILE"), dcsprop) == IDOK) 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; 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; break;
} }
else else