[SERVICES] RChangeServiceConfigW / RCreateServiceW: Use SecureZeroMemory to wipe clear-text passwords after use.

This commit is contained in:
Eric Kohl 2018-09-28 17:51:12 +02:00
parent b9aeb5bfbd
commit 04683639f0

View file

@ -2244,8 +2244,8 @@ done:
if (lpClearTextPassword != NULL)
{
/* Wipe and release the password buffer */
ZeroMemory(lpClearTextPassword,
(wcslen(lpClearTextPassword) + 1) * sizeof(WCHAR));
SecureZeroMemory(lpClearTextPassword,
(wcslen(lpClearTextPassword) + 1) * sizeof(WCHAR));
HeapFree(GetProcessHeap(), 0, lpClearTextPassword);
}
@ -2648,8 +2648,8 @@ done:
if (lpClearTextPassword != NULL)
{
/* Wipe and release the password buffer */
ZeroMemory(lpClearTextPassword,
(wcslen(lpClearTextPassword) + 1) * sizeof(WCHAR));
SecureZeroMemory(lpClearTextPassword,
(wcslen(lpClearTextPassword) + 1) * sizeof(WCHAR));
HeapFree(GetProcessHeap(), 0, lpClearTextPassword);
}