Alexandre Julliard : crypt32: Fix computation of structure sizes in CRYPT_AsnDecodeSequence.

Alexandre Julliard julliard at winehq.org
Thu Apr 8 11:12:41 CDT 2010


Module: wine
Branch: master
Commit: 87416f5a3b079f81a62a16672e1cf355a3da477a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=87416f5a3b079f81a62a16672e1cf355a3da477a

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Apr  7 23:07:43 2010 +0200

crypt32: Fix computation of structure sizes in CRYPT_AsnDecodeSequence.

---

 dlls/crypt32/decode.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c
index fb3d36e..655a5b2 100644
--- a/dlls/crypt32/decode.c
+++ b/dlls/crypt32/decode.c
@@ -523,9 +523,11 @@ static BOOL CRYPT_AsnDecodeSequence(struct AsnDecodeSequenceItem items[],
 
                 for (i = 0; i < cItem; i++)
                 {
-                    bytesNeeded += items[i].size;
+                    if (items[i].size > items[i].minSize)
+                        bytesNeeded += items[i].size - items[i].minSize;
                     structSize = max( structSize, items[i].offset + items[i].minSize );
                 }
+                bytesNeeded += structSize;
                 if (pcbDecoded)
                     *pcbDecoded = 1 + lenBytes + cbDecoded;
                 if (!pvStructInfo)




More information about the wine-cvs mailing list