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
No known key found for this signature in database
GPG Key ID: 02C30AE90FAE4A6F

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)
{
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