Commit b791c252 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

msiexec: Use FIELD_OFFSET to calculate the size of a struct with variable length array.

parent 96e428cc
...@@ -109,10 +109,8 @@ static BOOL IsProductCode(LPWSTR str) ...@@ -109,10 +109,8 @@ static BOOL IsProductCode(LPWSTR str)
static VOID StringListAppend(struct string_list **list, LPCWSTR str) static VOID StringListAppend(struct string_list **list, LPCWSTR str)
{ {
struct string_list *entry; struct string_list *entry;
DWORD size;
size = sizeof *entry + lstrlenW(str) * sizeof (WCHAR); entry = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(struct string_list, str[lstrlenW(str) + 1]));
entry = HeapAlloc(GetProcessHeap(), 0, size);
if(!entry) if(!entry)
{ {
WINE_ERR("Out of memory!\n"); WINE_ERR("Out of memory!\n");
......
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