Juan Lang : crypt32: Validate parameters better in CryptDecodeObject.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Aug 13 06:31:21 CDT 2007
Module: wine
Branch: master
Commit: 5d8d9e7d08836698d9f55153cece7c006f7c1751
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5d8d9e7d08836698d9f55153cece7c006f7c1751
Author: Juan Lang <juan.lang at gmail.com>
Date: Fri Aug 10 11:20:24 2007 -0700
crypt32: Validate parameters better in CryptDecodeObject.
---
dlls/crypt32/decode.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c
index c6f7305..7c50b27 100644
--- a/dlls/crypt32/decode.c
+++ b/dlls/crypt32/decode.c
@@ -4138,6 +4138,16 @@ BOOL WINAPI CryptDecodeObject(DWORD dwCertEncodingType, LPCSTR lpszStructType,
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
+ if (!cbEncoded)
+ {
+ SetLastError(CRYPT_E_ASN1_EOD);
+ return FALSE;
+ }
+ if (cbEncoded > MAX_ENCODED_LEN)
+ {
+ SetLastError(CRYPT_E_ASN1_LARGE);
+ return FALSE;
+ }
if (!(pCryptDecodeObjectEx = CRYPT_GetBuiltinDecoder(dwCertEncodingType,
lpszStructType)))
More information about the wine-cvs
mailing list