crypt32(3/4): Avoid a memory allocation when decoding the subject
key identifier extension
Juan Lang
juan.lang at gmail.com
Mon Aug 13 19:36:31 CDT 2007
--Juan
-------------- next part --------------
From 6da0e6c7baca682b7df530ae685e9057d4cd8a6c Mon Sep 17 00:00:00 2001
From: Juan Lang <juan.lang at gmail.com>
Date: Mon, 13 Aug 2007 14:31:02 -0700
Subject: [PATCH] Avoid a memory allocation when decoding the subject key identifier extension
---
dlls/crypt32/cert.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c
index ebcf526..d67278d 100644
--- a/dlls/crypt32/cert.c
+++ b/dlls/crypt32/cert.c
@@ -250,19 +250,18 @@ static BOOL WINAPI CertContext_GetProper
if (ext)
{
- CRYPT_DATA_BLOB *value;
+ CRYPT_DATA_BLOB value;
DWORD size;
ret = CryptDecodeObjectEx(X509_ASN_ENCODING,
szOID_SUBJECT_KEY_IDENTIFIER, ext->Value.pbData,
- ext->Value.cbData, CRYPT_DECODE_ALLOC_FLAG, NULL, &value,
+ ext->Value.cbData, CRYPT_DECODE_NOCOPY_FLAG, NULL, &value,
&size);
if (ret)
{
- ret = CertContext_CopyParam(pvData, pcbData, value->pbData,
- value->cbData);
- CertContext_SetProperty(context, dwPropId, 0, value);
- LocalFree(value);
+ ret = CertContext_CopyParam(pvData, pcbData, value.pbData,
+ value.cbData);
+ CertContext_SetProperty(context, dwPropId, 0, &value);
}
}
else
--
1.4.1
More information about the wine-patches
mailing list