Commit 1c35b251 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Don't underreport the size available when formatting szOID_AUTHORITY_KEY_IDENTIFIER2.

parent b627dd2a
...@@ -1089,6 +1089,10 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType, ...@@ -1089,6 +1089,10 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType,
if (info->KeyId.cbData) if (info->KeyId.cbData)
{ {
needSeparator = TRUE; needSeparator = TRUE;
/* Overestimate size available, it's already been checked
* above.
*/
size = bytesNeeded;
ret = CRYPT_FormatKeyId(&info->KeyId, str, &size); ret = CRYPT_FormatKeyId(&info->KeyId, str, &size);
if (ret) if (ret)
str += size / sizeof(WCHAR); str += size / sizeof(WCHAR);
...@@ -1101,6 +1105,10 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType, ...@@ -1101,6 +1105,10 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType,
str += sepLen / sizeof(WCHAR); str += sepLen / sizeof(WCHAR);
} }
needSeparator = TRUE; needSeparator = TRUE;
/* Overestimate size available, it's already been checked
* above.
*/
size = bytesNeeded;
ret = CRYPT_FormatCertIssuer(dwFormatStrType, ret = CRYPT_FormatCertIssuer(dwFormatStrType,
&info->AuthorityCertIssuer, str, &size); &info->AuthorityCertIssuer, str, &size);
if (ret) if (ret)
...@@ -1113,6 +1121,10 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType, ...@@ -1113,6 +1121,10 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType,
strcpyW(str, sep); strcpyW(str, sep);
str += sepLen / sizeof(WCHAR); str += sepLen / sizeof(WCHAR);
} }
/* Overestimate size available, it's already been checked
* above.
*/
size = bytesNeeded;
ret = CRYPT_FormatCertSerialNumber( ret = CRYPT_FormatCertSerialNumber(
&info->AuthorityCertSerialNumber, str, &size); &info->AuthorityCertSerialNumber, str, &size);
} }
......
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