crypt32: Explicitly pass pointers to blob arrays rather than relying on an invalid alignment assumption.
This commit is contained in:
parent
3000bc200a
commit
1437d7ccc2
|
@ -742,19 +742,13 @@ static BOOL CRYPT_ConstructBlobArray(DWORD *outCBlobs,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct _BlobArray
|
static void CRYPT_FreeBlobArray(DWORD cBlobs, PCRYPT_DATA_BLOB blobs)
|
||||||
{
|
|
||||||
DWORD cBlobs;
|
|
||||||
PCRYPT_DATA_BLOB blobs;
|
|
||||||
} BlobArray;
|
|
||||||
|
|
||||||
static void CRYPT_FreeBlobArray(BlobArray *array)
|
|
||||||
{
|
{
|
||||||
DWORD i;
|
DWORD i;
|
||||||
|
|
||||||
for (i = 0; i < array->cBlobs; i++)
|
for (i = 0; i < cBlobs; i++)
|
||||||
CryptMemFree(array->blobs[i].pbData);
|
CryptMemFree(blobs[i].pbData);
|
||||||
CryptMemFree(array->blobs);
|
CryptMemFree(blobs);
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL CRYPT_ConstructAttribute(CRYPT_ATTRIBUTE *out,
|
static BOOL CRYPT_ConstructAttribute(CRYPT_ATTRIBUTE *out,
|
||||||
|
@ -1180,8 +1174,10 @@ static void CSignedEncodeMsg_Close(HCRYPTMSG hCryptMsg)
|
||||||
|
|
||||||
CryptMemFree(msg->innerOID);
|
CryptMemFree(msg->innerOID);
|
||||||
CryptMemFree(msg->data.pbData);
|
CryptMemFree(msg->data.pbData);
|
||||||
CRYPT_FreeBlobArray((BlobArray *)&msg->msg_data.info->cCertEncoded);
|
CRYPT_FreeBlobArray(msg->msg_data.info->cCertEncoded,
|
||||||
CRYPT_FreeBlobArray((BlobArray *)&msg->msg_data.info->cCrlEncoded);
|
msg->msg_data.info->rgCertEncoded);
|
||||||
|
CRYPT_FreeBlobArray(msg->msg_data.info->cCrlEncoded,
|
||||||
|
msg->msg_data.info->rgCrlEncoded);
|
||||||
for (i = 0; i < msg->msg_data.info->cSignerInfo; i++)
|
for (i = 0; i < msg->msg_data.info->cSignerInfo; i++)
|
||||||
CSignerInfo_Free(&msg->msg_data.info->rgSignerInfo[i]);
|
CSignerInfo_Free(&msg->msg_data.info->rgSignerInfo[i]);
|
||||||
CSignedMsgData_CloseHandles(&msg->msg_data);
|
CSignedMsgData_CloseHandles(&msg->msg_data);
|
||||||
|
|
Loading…
Reference in New Issue