From 3cdd20f91de873f806621f0f2163c7c2ce7c4f3d Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Tue, 15 Feb 2011 11:31:16 -0800 Subject: [PATCH] crypt32: Don't assign a count value unless memory allocation succeeds (clang). --- dlls/crypt32/encode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c index 825eb44c783..6b61337c2e4 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++) {