Juan Lang : crypt32: Don' t assign a count value unless memory allocation succeeds (clang).
Alexandre Julliard
julliard at winehq.org
Wed Feb 16 11:14:11 CST 2011
Module: wine
Branch: master
Commit: 3cdd20f91de873f806621f0f2163c7c2ce7c4f3d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3cdd20f91de873f806621f0f2163c7c2ce7c4f3d
Author: Juan Lang <juan.lang at gmail.com>
Date: Tue Feb 15 11:31:16 2011 -0800
crypt32: Don't assign a count value unless memory allocation succeeds (clang).
---
dlls/crypt32/encode.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c
index 825eb44..6b61337 100644
--- a/dlls/crypt32/encode.c
+++ b/dlls/crypt32/encode.c
@@ -1330,13 +1330,15 @@ static BOOL CRYPT_AsnEncodeRdn(DWORD dwCertEncodingType, const CERT_RDN *rdn,
ret = TRUE;
if (rdn->cRDNAttr)
{
- setOf.cBlob = rdn->cRDNAttr;
setOf.rgBlob = CryptMemAlloc(rdn->cRDNAttr *
sizeof(CRYPT_DER_BLOB));
if (!setOf.rgBlob)
ret = FALSE;
else
+ {
+ setOf.cBlob = rdn->cRDNAttr;
memset(setOf.rgBlob, 0, setOf.cBlob * sizeof(CRYPT_DER_BLOB));
+ }
}
for (i = 0; ret && i < rdn->cRDNAttr; i++)
{
More information about the wine-cvs
mailing list