Karsten Elfenbein : rsaenh: Fix the case when the CPEncrypt function is asked for the needed buffer size .

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jul 26 04:22:48 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: bf1ad6c324c5837cba5035747107423931f7352c
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=bf1ad6c324c5837cba5035747107423931f7352c

Author: Karsten Elfenbein <kelfe at gmx.de>
Date:   Tue Jul 25 20:57:34 2006 +0200

rsaenh: Fix the case when the CPEncrypt function is asked for the needed buffer size.

---

 dlls/rsaenh/rsaenh.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c
index cd474c6..7c9dcfb 100644
--- a/dlls/rsaenh/rsaenh.c
+++ b/dlls/rsaenh/rsaenh.c
@@ -1889,6 +1889,12 @@ BOOL WINAPI RSAENH_CPEncrypt(HCRYPTPROV 
         }
 
         dwEncryptedLen = (*pdwDataLen/pCryptKey->dwBlockLen+(Final?1:0))*pCryptKey->dwBlockLen;
+
+        if (pbData == NULL) {
+            *pdwDataLen = dwEncryptedLen;
+            return TRUE;
+        }
+
         for (i=*pdwDataLen; i<dwEncryptedLen && i<dwBufLen; i++) pbData[i] = dwEncryptedLen - *pdwDataLen;
         *pdwDataLen = dwEncryptedLen; 
 




More information about the wine-cvs mailing list