crypt32: Validate parameters better in CryptDecodeObject.

This commit is contained in:
Juan Lang 2007-08-10 11:20:24 -07:00 committed by Alexandre Julliard
parent 4c58c4bc2f
commit 5d8d9e7d08
1 changed files with 10 additions and 0 deletions

View File

@ -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)))