Commit 65e8bf6f authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Properly NULL-terminate decoded UTF8 strings.

parent f290ec49
......@@ -1724,9 +1724,8 @@ static BOOL CRYPT_AsnDecodeUnicodeNameValueInternal(const BYTE *pbEncoded,
case ASN_UTF8STRING:
value->Value.cbData = MultiByteToWideChar(CP_UTF8, 0,
(LPCSTR)pbEncoded + 1 + lenBytes, dataLen,
str, bytesNeeded - sizeof(CERT_NAME_VALUE)) * 2;
value->Value.pbData[value->Value.cbData / sizeof(WCHAR)]
= 0;
str, bytesNeeded - sizeof(CERT_NAME_VALUE)) * sizeof(WCHAR);
*(WCHAR *)(value->Value.pbData + value->Value.cbData) = 0;
value->Value.cbData += sizeof(WCHAR);
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment