crypt32: Make sure item size is at least the min size, and only align sizes that are greater.

This commit is contained in:
Juan Lang 2009-10-22 13:31:00 -07:00 committed by Alexandre Julliard
parent a5087e6051
commit c593173d15
1 changed files with 7 additions and 2 deletions

View File

@ -357,8 +357,13 @@ static BOOL CRYPT_AsnDecodeSequenceItems(struct AsnDecodeSequenceItem items[],
: NULL, &items[i].size, &itemDecoded);
if (ret)
{
/* Account for alignment padding */
items[i].size = ALIGN_DWORD_PTR(items[i].size);
if (items[i].size < items[i].minSize)
items[i].size = items[i].minSize;
else if (items[i].size > items[i].minSize)
{
/* Account for alignment padding */
items[i].size = ALIGN_DWORD_PTR(items[i].size);
}
TRACE("item %d size: %d\n", i, items[i].size);
if (nextData && items[i].hasPointer &&
items[i].size > items[i].minSize)