mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 12:49:45 +00:00
oleaut32: Handle strings with a length of 0xffff in SLTG_DoVars.
This means that the string is NULL so don't attempt to access the string data in this case.
This commit is contained in:
parent
caf875f4ee
commit
9f9d8dc683
@ -3161,9 +3161,15 @@ static void SLTG_DoVars(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, unsign
|
||||
case VT_BSTR:
|
||||
{
|
||||
WORD len = *(WORD *)(pBlk + pItem->byte_offs);
|
||||
INT alloc_len = MultiByteToWideChar(CP_ACP, 0, pBlk + pItem->byte_offs + 2, len, NULL, 0);
|
||||
BSTR str = SysAllocStringLen(NULL, alloc_len);
|
||||
MultiByteToWideChar(CP_ACP, 0, pBlk + pItem->byte_offs + 2, len, str, alloc_len);
|
||||
BSTR str;
|
||||
TRACE_(typelib)("len = %u\n", len);
|
||||
if (len == 0xffff) {
|
||||
str = NULL;
|
||||
} else {
|
||||
INT alloc_len = MultiByteToWideChar(CP_ACP, 0, pBlk + pItem->byte_offs + 2, len, NULL, 0);
|
||||
str = SysAllocStringLen(NULL, alloc_len);
|
||||
MultiByteToWideChar(CP_ACP, 0, pBlk + pItem->byte_offs + 2, len, str, alloc_len);
|
||||
}
|
||||
V_VT((*ppVarDesc)->vardesc.u.lpvarValue) = VT_BSTR;
|
||||
V_BSTR((*ppVarDesc)->vardesc.u.lpvarValue) = str;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user