From c593173d153d5fcde304a9285b1f930ede647c37 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Thu, 22 Oct 2009 13:31:00 -0700 Subject: [PATCH] crypt32: Make sure item size is at least the min size, and only align sizes that are greater. --- dlls/crypt32/decode.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c index 32e61cc7800..fa1cc63de6b 100644 --- a/dlls/crypt32/decode.c +++ b/dlls/crypt32/decode.c @@ -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)