[Wine-patches] Fix a problem with copying CryptoPro container (eterbug #1161).

Alexander Morozov amorozov на etersoft.ru
Ср Мар 24 20:42:13 MSK 2010


----------- следующая часть -----------
From 4fce082bc9f3b6dc49081f0af70ed07b6007d0fd Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Wed, 24 Mar 2010 20:29:41 +0300
Subject: [PATCH] Fix a problem with copying CryptoPro container (eterbug #1161).

---
 dlls/advapi32/crypt.c |    2 +-
 dlls/rsaenh/rsaenh.c  |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/dlls/advapi32/crypt.c b/dlls/advapi32/crypt.c
index d1fc25d..c32e510 100644
--- a/dlls/advapi32/crypt.c
+++ b/dlls/advapi32/crypt.c
@@ -1961,7 +1961,7 @@ BOOL WINAPI CryptSetKeyParam (HCRYPTKEY hKey, DWORD dwParam, CONST BYTE *pbData,
 
 	TRACE("(0x%lx, %d, %p, %08x)\n", hKey, dwParam, pbData, dwFlags);
 
-	if (!key || !pbData || !key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV)
+	if (!key || !key->pProvider || key->pProvider->dwMagic != MAGIC_CRYPTPROV)
 	{
 		SetLastError(ERROR_INVALID_PARAMETER);
 		return FALSE;
diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c
index f44db39..dfdc437 100644
--- a/dlls/rsaenh/rsaenh.c
+++ b/dlls/rsaenh/rsaenh.c
@@ -3183,6 +3183,12 @@ BOOL WINAPI RSAENH_CPSetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam
     TRACE("(hProv=%08lx, hKey=%08lx, dwParam=%08x, pbData=%p, dwFlags=%08x)\n", hProv, hKey,
           dwParam, pbData, dwFlags);
 
+    if (!pbData)
+    {
+        SetLastError(ERROR_INVALID_PARAMETER);
+        return FALSE;
+    }
+
     if (!is_valid_handle(&handle_table, hProv, RSAENH_MAGIC_CONTAINER))
     {
         SetLastError(NTE_BAD_UID);
-- 
1.6.5.8



Подробная информация о списке рассылки Wine-patches