Commit 64b320b7 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

wintrust: Correct alignment for 64-bit.

parent 15512454
...@@ -1465,6 +1465,10 @@ struct AsnDecodeSequenceItem ...@@ -1465,6 +1465,10 @@ struct AsnDecodeSequenceItem
DWORD size; DWORD size;
}; };
/* Align up to a DWORD_PTR boundary
*/
#define ALIGN_DWORD_PTR(x) (((x) + sizeof(DWORD_PTR) - 1) & ~(sizeof(DWORD_PTR) - 1))
/* Decodes the items in a sequence, where the items are described in items, /* Decodes the items in a sequence, where the items are described in items,
* the encoded data are in pbEncoded with length cbEncoded. Decodes into * the encoded data are in pbEncoded with length cbEncoded. Decodes into
* pvStructInfo. nextData is a pointer to the memory location at which the * pvStructInfo. nextData is a pointer to the memory location at which the
...@@ -1517,9 +1521,7 @@ static BOOL CRYPT_AsnDecodeSequenceItems(DWORD dwCertEncodingType, ...@@ -1517,9 +1521,7 @@ static BOOL CRYPT_AsnDecodeSequenceItems(DWORD dwCertEncodingType,
if (ret) if (ret)
{ {
/* Account for alignment padding */ /* Account for alignment padding */
if (items[i].size % sizeof(DWORD)) items[i].size = ALIGN_DWORD_PTR(items[i].size);
items[i].size += sizeof(DWORD) -
items[i].size % sizeof(DWORD);
TRACE("item %d size: %d\n", i, items[i].size); TRACE("item %d size: %d\n", i, items[i].size);
if (nextData && items[i].hasPointer && if (nextData && items[i].hasPointer &&
items[i].size > items[i].minSize) items[i].size > items[i].minSize)
......
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