Juan Lang : crypt32: Don' t underreport the size available when formatting szOID_AUTHORITY_KEY_IDENTIFIER2 .
Alexandre Julliard
julliard at winehq.org
Thu Nov 13 08:51:28 CST 2008
Module: wine
Branch: master
Commit: 1c35b251e87445eac0aa9c6a6797f65a6c9f5c6a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1c35b251e87445eac0aa9c6a6797f65a6c9f5c6a
Author: Juan Lang <juan.lang at gmail.com>
Date: Wed Nov 12 20:22:32 2008 -0800
crypt32: Don't underreport the size available when formatting szOID_AUTHORITY_KEY_IDENTIFIER2.
---
dlls/crypt32/object.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/dlls/crypt32/object.c b/dlls/crypt32/object.c
index 19a3217..f5a6483 100644
--- a/dlls/crypt32/object.c
+++ b/dlls/crypt32/object.c
@@ -1089,6 +1089,10 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType,
if (info->KeyId.cbData)
{
needSeparator = TRUE;
+ /* Overestimate size available, it's already been checked
+ * above.
+ */
+ size = bytesNeeded;
ret = CRYPT_FormatKeyId(&info->KeyId, str, &size);
if (ret)
str += size / sizeof(WCHAR);
@@ -1101,6 +1105,10 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType,
str += sepLen / sizeof(WCHAR);
}
needSeparator = TRUE;
+ /* Overestimate size available, it's already been checked
+ * above.
+ */
+ size = bytesNeeded;
ret = CRYPT_FormatCertIssuer(dwFormatStrType,
&info->AuthorityCertIssuer, str, &size);
if (ret)
@@ -1113,6 +1121,10 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType,
strcpyW(str, sep);
str += sepLen / sizeof(WCHAR);
}
+ /* Overestimate size available, it's already been checked
+ * above.
+ */
+ size = bytesNeeded;
ret = CRYPT_FormatCertSerialNumber(
&info->AuthorityCertSerialNumber, str, &size);
}
More information about the wine-cvs
mailing list