Commit 0e967a5c authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

secur32: Use SecureZeroMemory to clear magic fields.

parent 2367415d
...@@ -156,7 +156,8 @@ NTSTATUS WINAPI LsaDeregisterLogonProcess(HANDLE LsaHandle) ...@@ -156,7 +156,8 @@ NTSTATUS WINAPI LsaDeregisterLogonProcess(HANDLE LsaHandle)
TRACE("%p\n", LsaHandle); TRACE("%p\n", LsaHandle);
if (!lsa_conn || lsa_conn->magic != LSA_MAGIC_CONNECTION) return STATUS_INVALID_HANDLE; if (!lsa_conn || lsa_conn->magic != LSA_MAGIC_CONNECTION) return STATUS_INVALID_HANDLE;
lsa_conn->magic = 0; /* Ensure compiler doesn't optimize out the assignment with 0. */
SecureZeroMemory(&lsa_conn->magic, sizeof(lsa_conn->magic));
free(lsa_conn); free(lsa_conn);
return STATUS_SUCCESS; return STATUS_SUCCESS;
...@@ -465,7 +466,8 @@ static SECURITY_STATUS WINAPI lsa_FreeCredentialsHandle(CredHandle *credential) ...@@ -465,7 +466,8 @@ static SECURITY_STATUS WINAPI lsa_FreeCredentialsHandle(CredHandle *credential)
status = lsa_cred->package->lsa_api->FreeCredentialsHandle(lsa_cred->handle); status = lsa_cred->package->lsa_api->FreeCredentialsHandle(lsa_cred->handle);
lsa_cred->magic = 0; /* Ensure compiler doesn't optimize out the assignment with 0. */
SecureZeroMemory(&lsa_cred->magic, sizeof(lsa_cred->magic));
free(lsa_cred); free(lsa_cred);
return status; return status;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment