Henri Verbeet : crypt32: Use a larger temporary buffer in CRYPT_AsnDecodeOidIgnoreTag().

Alexandre Julliard julliard at winehq.org
Thu Jan 26 14:49:24 CST 2012


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Jan 26 00:21:19 2012 +0100

crypt32: Use a larger temporary buffer in CRYPT_AsnDecodeOidIgnoreTag().

---

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

diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c
index 4a22533..bdcb744 100644
--- a/dlls/crypt32/decode.c
+++ b/dlls/crypt32/decode.c
@@ -1310,22 +1310,17 @@ static BOOL CRYPT_AsnDecodeOidIgnoreTag(const BYTE *pbEncoded, DWORD cbEncoded,
 
         if (dataLen)
         {
-            /* The largest possible string for the first two components
-             * is 2.175 (= 2 * 40 + 175 = 255), so this is big enough.
-             */
-            char firstTwo[6];
             const BYTE *ptr;
+            char str[32];
 
-            snprintf(firstTwo, sizeof(firstTwo), "%d.%d",
+            snprintf(str, sizeof(str), "%d.%d",
              pbEncoded[1 + lenBytes] / 40,
              pbEncoded[1 + lenBytes] - (pbEncoded[1 + lenBytes] / 40)
              * 40);
-            bytesNeeded += strlen(firstTwo) + 1;
+            bytesNeeded += strlen(str) + 1;
             for (ptr = pbEncoded + 2 + lenBytes; ret &&
              ptr - pbEncoded - 1 - lenBytes < dataLen; )
             {
-                /* large enough for ".4000000" */
-                char str[9];
                 int val = 0;
 
                 while (ptr - pbEncoded - 1 - lenBytes < dataLen &&




More information about the wine-cvs mailing list