Juan Lang : crypt32: Return FALSE rather than crash if memory allocation fails. Fixes Coverity id 135.

Alexandre Julliard julliard at winehq.org
Wed Sep 10 06:01:34 CDT 2008


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Tue Sep  9 10:22:59 2008 -0700

crypt32: Return FALSE rather than crash if memory allocation fails. Fixes Coverity id 135.

---

 dlls/crypt32/cert.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c
index d9ab229..8de96c8 100644
--- a/dlls/crypt32/cert.c
+++ b/dlls/crypt32/cert.c
@@ -607,6 +607,11 @@ static BOOL CRYPT_AcquirePrivateKeyFromProvInfo(PCCERT_CONTEXT pCert,
                  CERT_KEY_PROV_INFO_PROP_ID, info, &size);
                 allocated = TRUE;
             }
+            else
+            {
+                SetLastError(ERROR_OUTOFMEMORY);
+                ret = FALSE;
+            }
         }
         else
             SetLastError(CRYPT_E_NO_KEY_PROPERTY);




More information about the wine-cvs mailing list