Commit 70c4b667 authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

crypt32: Assign to structs instead of using memcpy.

parent 649d8b52
...@@ -986,8 +986,7 @@ static BOOL CRYPT_BuildCandidateChainFromCert(HCERTCHAINENGINE hChainEngine, ...@@ -986,8 +986,7 @@ static BOOL CRYPT_BuildCandidateChainFromCert(HCERTCHAINENGINE hChainEngine,
chain->ref = 1; chain->ref = 1;
chain->world = world; chain->world = world;
chain->context.cbSize = sizeof(CERT_CHAIN_CONTEXT); chain->context.cbSize = sizeof(CERT_CHAIN_CONTEXT);
memcpy(&chain->context.TrustStatus, &simpleChain->TrustStatus, chain->context.TrustStatus = simpleChain->TrustStatus;
sizeof(CERT_TRUST_STATUS));
chain->context.cChain = 1; chain->context.cChain = 1;
chain->context.rgpChain = CryptMemAlloc(sizeof(PCERT_SIMPLE_CHAIN)); chain->context.rgpChain = CryptMemAlloc(sizeof(PCERT_SIMPLE_CHAIN));
chain->context.rgpChain[0] = simpleChain; chain->context.rgpChain[0] = simpleChain;
...@@ -1029,8 +1028,7 @@ static PCERT_SIMPLE_CHAIN CRYPT_CopySimpleChainToElement( ...@@ -1029,8 +1028,7 @@ static PCERT_SIMPLE_CHAIN CRYPT_CopySimpleChainToElement(
if (element) if (element)
{ {
memcpy(element, chain->rgpElement[i], *element = *chain->rgpElement[i];
sizeof(CERT_CHAIN_ELEMENT));
element->pCertContext = CertDuplicateCertificateContext( element->pCertContext = CertDuplicateCertificateContext(
chain->rgpElement[i]->pCertContext); chain->rgpElement[i]->pCertContext);
/* Reset the trust status of the copied element, it'll get /* Reset the trust status of the copied element, it'll get
......
...@@ -78,7 +78,7 @@ static inline void CryptMsgBase_Init(CryptMsgBase *msg, DWORD dwFlags, ...@@ -78,7 +78,7 @@ static inline void CryptMsgBase_Init(CryptMsgBase *msg, DWORD dwFlags,
if (pStreamInfo) if (pStreamInfo)
{ {
msg->streamed = TRUE; msg->streamed = TRUE;
memcpy(&msg->stream_info, pStreamInfo, sizeof(msg->stream_info)); msg->stream_info = *pStreamInfo;
} }
else else
{ {
...@@ -1124,7 +1124,7 @@ static BOOL CSignedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType, ...@@ -1124,7 +1124,7 @@ static BOOL CSignedEncodeMsg_GetParam(HCRYPTMSG hCryptMsg, DWORD dwParamType,
CRYPT_SIGNED_INFO info; CRYPT_SIGNED_INFO info;
char oid_rsa_data[] = szOID_RSA_data; char oid_rsa_data[] = szOID_RSA_data;
memcpy(&info, msg->msg_data.info, sizeof(info)); info = *msg->msg_data.info;
/* Quirk: OID is only encoded messages if an update has happened */ /* Quirk: OID is only encoded messages if an update has happened */
if (msg->base.state != MsgStateInit) if (msg->base.state != MsgStateInit)
info.content.pszObjId = oid_rsa_data; info.content.pszObjId = oid_rsa_data;
......
...@@ -325,7 +325,7 @@ BOOL WINAPI CryptSIPRetrieveSubjectGuid ...@@ -325,7 +325,7 @@ BOOL WINAPI CryptSIPRetrieveSubjectGuid
dos = (IMAGE_DOS_HEADER *)pMapped; dos = (IMAGE_DOS_HEADER *)pMapped;
if (dos->e_magic == IMAGE_DOS_SIGNATURE) if (dos->e_magic == IMAGE_DOS_SIGNATURE)
{ {
memcpy(pgSubject, &unknown, sizeof(GUID)); *pgSubject = unknown;
SetLastError(S_OK); SetLastError(S_OK);
bRet = TRUE; bRet = TRUE;
goto cleanup1; goto cleanup1;
...@@ -435,8 +435,8 @@ static void CRYPT_CacheSIP(const GUID *pgSubject, SIP_DISPATCH_INFO *info) ...@@ -435,8 +435,8 @@ static void CRYPT_CacheSIP(const GUID *pgSubject, SIP_DISPATCH_INFO *info)
if (prov) if (prov)
{ {
memcpy(&prov->subject, pgSubject, sizeof(prov->subject)); prov->subject = *pgSubject;
memcpy(&prov->info, info, sizeof(prov->info)); prov->info = *info;
EnterCriticalSection(&providers_cs); EnterCriticalSection(&providers_cs);
list_add_tail(&providers, &prov->entry); list_add_tail(&providers, &prov->entry);
LeaveCriticalSection(&providers_cs); LeaveCriticalSection(&providers_cs);
......
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