Commit fce67d1e authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

wintrust: Use SecureZeroMemory() to clear magic fields.

parent c20a0dc6
......@@ -424,7 +424,8 @@ BOOL WINAPI CryptCATAdminReleaseCatalogContext(HCATADMIN hCatAdmin,
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
ci->magic = 0;
/* Ensure compiler doesn't optimize out the assignment with 0. */
SecureZeroMemory(&ci->magic, sizeof(ci->magic));
free(ci);
return TRUE;
}
......@@ -455,7 +456,8 @@ BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags )
return FALSE;
}
if (ca->find != INVALID_HANDLE_VALUE) FindClose(ca->find);
ca->magic = 0;
/* Ensure compiler doesn't optimize out the assignment with 0. */
SecureZeroMemory(&ca->magic, sizeof(ca->magic));
free(ca);
return TRUE;
}
......@@ -555,7 +557,8 @@ BOOL WINAPI CryptCATClose(HANDLE hCatalog)
free(cc->inner);
CryptMsgClose(cc->msg);
cc->magic = 0;
/* Ensure compiler doesn't optimize out the assignment with 0. */
SecureZeroMemory(&cc->magic, sizeof(cc->magic));
free(cc);
return TRUE;
}
......
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