crypt32: Don't assume string pointer has been set if length is 0.
This commit is contained in:
parent
7cf611ef3b
commit
d34b3bf63c
@ -913,8 +913,12 @@ static BOOL CRYPT_AsnEncodeBMPString(const CERT_NAME_VALUE *value,
|
|||||||
LPCWSTR str = (LPCWSTR)value->Value.pbData;
|
LPCWSTR str = (LPCWSTR)value->Value.pbData;
|
||||||
DWORD bytesNeeded, lenBytes, strLen;
|
DWORD bytesNeeded, lenBytes, strLen;
|
||||||
|
|
||||||
strLen = value->Value.cbData ? value->Value.cbData / sizeof(WCHAR) :
|
if (value->Value.cbData)
|
||||||
lstrlenW(str);
|
strLen = value->Value.cbData / sizeof(WCHAR);
|
||||||
|
else if (value->Value.pbData)
|
||||||
|
strLen = lstrlenW(str);
|
||||||
|
else
|
||||||
|
strLen = 0;
|
||||||
CRYPT_EncodeLen(strLen * 2, NULL, &lenBytes);
|
CRYPT_EncodeLen(strLen * 2, NULL, &lenBytes);
|
||||||
bytesNeeded = 1 + lenBytes + strLen * 2;
|
bytesNeeded = 1 + lenBytes + strLen * 2;
|
||||||
if (!pbEncoded)
|
if (!pbEncoded)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user