Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/crypt32/cert.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index e591c4dd45..2d4ce8c10c 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -533,14 +533,19 @@ void CRYPT_FixKeyProvInfoPointers(PCRYPT_KEY_PROV_INFO info) provNameLen = (lstrlenW(info->pwszProvName) + 1) * sizeof(WCHAR); data += provNameLen;
- info->rgProvParam = (PCRYPT_KEY_PROV_PARAM)data; - data += info->cProvParam * sizeof(CRYPT_KEY_PROV_PARAM); - - for (i = 0; i < info->cProvParam; i++) + if (info->cProvParam) { - info->rgProvParam[i].pbData = data; - data += info->rgProvParam[i].cbData; + info->rgProvParam = (PCRYPT_KEY_PROV_PARAM)data; + data += info->cProvParam * sizeof(CRYPT_KEY_PROV_PARAM); + + for (i = 0; i < info->cProvParam; i++) + { + info->rgProvParam[i].pbData = data; + data += info->rgProvParam[i].cbData; + } } + else + info->rgProvParam = NULL; }
BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext,