crypt32: Avoid a memory allocation when decoding the subject key identifier extension.
This commit is contained in:
parent
d49c9d59d1
commit
f7bcc26cc5
|
@ -250,19 +250,18 @@ static BOOL WINAPI CertContext_GetProperty(void *context, DWORD dwPropId,
|
||||||
|
|
||||||
if (ext)
|
if (ext)
|
||||||
{
|
{
|
||||||
CRYPT_DATA_BLOB *value;
|
CRYPT_DATA_BLOB value;
|
||||||
DWORD size;
|
DWORD size;
|
||||||
|
|
||||||
ret = CryptDecodeObjectEx(X509_ASN_ENCODING,
|
ret = CryptDecodeObjectEx(X509_ASN_ENCODING,
|
||||||
szOID_SUBJECT_KEY_IDENTIFIER, ext->Value.pbData,
|
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);
|
&size);
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
ret = CertContext_CopyParam(pvData, pcbData, value->pbData,
|
ret = CertContext_CopyParam(pvData, pcbData, value.pbData,
|
||||||
value->cbData);
|
value.cbData);
|
||||||
CertContext_SetProperty(context, dwPropId, 0, value);
|
CertContext_SetProperty(context, dwPropId, 0, &value);
|
||||||
LocalFree(value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue