cryptnet: Check number of contexts in CertDllVerifyRevocation.

This commit is contained in:
Juan Lang 2009-11-19 10:13:04 -08:00 committed by Alexandre Julliard
parent be1fd9b3f1
commit a82678da97
2 changed files with 5 additions and 3 deletions

View File

@ -1467,6 +1467,11 @@ BOOL WINAPI CertDllVerifyRevocation(DWORD dwEncodingType, DWORD dwRevType,
SetLastError(E_INVALIDARG); SetLastError(E_INVALIDARG);
return FALSE; return FALSE;
} }
if (!cContext)
{
SetLastError(E_INVALIDARG);
return FALSE;
}
memset(&pRevStatus->dwIndex, 0, pRevStatus->cbSize - sizeof(DWORD)); memset(&pRevStatus->dwIndex, 0, pRevStatus->cbSize - sizeof(DWORD));
if (dwRevType != CERT_CONTEXT_REVOCATION_TYPE) if (dwRevType != CERT_CONTEXT_REVOCATION_TYPE)
{ {

View File

@ -506,19 +506,16 @@ static void test_verifyRevocation(void)
} }
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pCertVerifyRevocation(0, 0, 0, NULL, 0, NULL, &status); ret = pCertVerifyRevocation(0, 0, 0, NULL, 0, NULL, &status);
todo_wine
ok(!ret && GetLastError() == E_INVALIDARG, ok(!ret && GetLastError() == E_INVALIDARG,
"expected E_INVALIDARG, got %08x\n", GetLastError()); "expected E_INVALIDARG, got %08x\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pCertVerifyRevocation(X509_ASN_ENCODING, 0, 0, NULL, 0, NULL, ret = pCertVerifyRevocation(X509_ASN_ENCODING, 0, 0, NULL, 0, NULL,
&status); &status);
todo_wine
ok(!ret && GetLastError() == E_INVALIDARG, ok(!ret && GetLastError() == E_INVALIDARG,
"expected E_INVALIDARG, got %08x\n", GetLastError()); "expected E_INVALIDARG, got %08x\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pCertVerifyRevocation(0, CERT_CONTEXT_REVOCATION_TYPE, 0, NULL, 0, ret = pCertVerifyRevocation(0, CERT_CONTEXT_REVOCATION_TYPE, 0, NULL, 0,
NULL, &status); NULL, &status);
todo_wine
ok(!ret && GetLastError() == E_INVALIDARG, ok(!ret && GetLastError() == E_INVALIDARG,
"expected E_INVALIDARG, got %08x\n", GetLastError()); "expected E_INVALIDARG, got %08x\n", GetLastError());
certs[0] = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert, certs[0] = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert,