msi: ExpandEnvironmentStringsW returns the required size in characters, so multiply the required size by sizeof(WCHAR) when allocating the buffer.
This commit is contained in:
parent
9ac7949810
commit
6b8b82ef13
|
@ -1498,7 +1498,7 @@ static void variant_from_registry_value(VARIANT *pVarResult, DWORD dwType, LPBYT
|
|||
case REG_EXPAND_SZ:
|
||||
if (!(dwNewSize = ExpandEnvironmentStringsW(szString, szNewString, dwNewSize)))
|
||||
ERR("ExpandEnvironmentStrings returned error %d\n", GetLastError());
|
||||
else if (!(szNewString = msi_alloc(dwNewSize)))
|
||||
else if (!(szNewString = msi_alloc(dwNewSize * sizeof(WCHAR))))
|
||||
ERR("Out of memory\n");
|
||||
else if (!(dwNewSize = ExpandEnvironmentStringsW(szString, szNewString, dwNewSize)))
|
||||
ERR("ExpandEnvironmentStrings returned error %d\n", GetLastError());
|
||||
|
|
Loading…
Reference in New Issue