Commit d12ca0dd authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

cryptnet: Use RTL_SIZEOF_THROUGH_FIELD.

parent bdcddf02
...@@ -521,13 +521,13 @@ static BOOL CRYPT_GetObjectFromCache(LPCWSTR pszURL, PCRYPT_BLOB_ARRAY pObject, ...@@ -521,13 +521,13 @@ static BOOL CRYPT_GetObjectFromCache(LPCWSTR pszURL, PCRYPT_BLOB_ARRAY pObject,
{ {
if ((ret = CRYPT_GetObjectFromFile(hFile, pObject))) if ((ret = CRYPT_GetObjectFromFile(hFile, pObject)))
{ {
if (pAuxInfo && pAuxInfo->cbSize >= if (pAuxInfo && pAuxInfo->cbSize >= RTL_SIZEOF_THROUGH_FIELD(CRYPT_RETRIEVE_AUX_INFO, pLastSyncTime)
offsetof(CRYPT_RETRIEVE_AUX_INFO, && pAuxInfo->pLastSyncTime)
pLastSyncTime) + sizeof(PFILETIME) && {
pAuxInfo->pLastSyncTime)
memcpy(pAuxInfo->pLastSyncTime, memcpy(pAuxInfo->pLastSyncTime,
&pCacheInfo->LastSyncTime, &pCacheInfo->LastSyncTime,
sizeof(FILETIME)); sizeof(FILETIME));
}
} }
CloseHandle(hFile); CloseHandle(hFile);
} }
...@@ -1028,12 +1028,12 @@ static BOOL WINAPI File_RetrieveEncodedObjectW(LPCWSTR pszURL, ...@@ -1028,12 +1028,12 @@ static BOOL WINAPI File_RetrieveEncodedObjectW(LPCWSTR pszURL,
{ {
if ((ret = CRYPT_GetObjectFromFile(hFile, pObject))) if ((ret = CRYPT_GetObjectFromFile(hFile, pObject)))
{ {
if (pAuxInfo && pAuxInfo->cbSize >= if (pAuxInfo && pAuxInfo->cbSize >= RTL_SIZEOF_THROUGH_FIELD(CRYPT_RETRIEVE_AUX_INFO, pLastSyncTime)
offsetof(CRYPT_RETRIEVE_AUX_INFO, && pAuxInfo->pLastSyncTime)
pLastSyncTime) + sizeof(PFILETIME) && {
pAuxInfo->pLastSyncTime)
GetFileTime(hFile, NULL, NULL, GetFileTime(hFile, NULL, NULL,
pAuxInfo->pLastSyncTime); pAuxInfo->pLastSyncTime);
}
} }
CloseHandle(hFile); CloseHandle(hFile);
} }
...@@ -1557,9 +1557,8 @@ static DWORD verify_cert_revocation_from_dist_points_ext( ...@@ -1557,9 +1557,8 @@ static DWORD verify_cert_revocation_from_dist_points_ext(
&cbUrlArray, NULL, NULL); &cbUrlArray, NULL, NULL);
if (dwFlags & CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION) if (dwFlags & CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION)
retrievalFlags |= CRYPT_CACHE_ONLY_RETRIEVAL; retrievalFlags |= CRYPT_CACHE_ONLY_RETRIEVAL;
if (dwFlags & CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG && if ((dwFlags & CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG) && pRevPara
pRevPara && pRevPara->cbSize >= offsetof(CERT_REVOCATION_PARA, && pRevPara->cbSize >= RTL_SIZEOF_THROUGH_FIELD(CERT_REVOCATION_PARA, dwUrlRetrievalTimeout))
dwUrlRetrievalTimeout) + sizeof(DWORD))
{ {
startTime = GetTickCount(); startTime = GetTickCount();
endTime = startTime + pRevPara->dwUrlRetrievalTimeout; endTime = startTime + pRevPara->dwUrlRetrievalTimeout;
......
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