advpack: Leave room for the NULL terminator in the working_dir string.

oldstable
James Hawkins 2006-04-28 20:02:48 -05:00 committed by Alexandre Julliard
parent 48b55afa56
commit b3347c49a1
1 changed files with 2 additions and 2 deletions

View File

@ -306,11 +306,11 @@ HRESULT install_init(LPCWSTR inf_filename, LPCWSTR install_sec,
}
else
{
len = lstrlenW(working_dir);
len = lstrlenW(working_dir) + 1;
ptr = working_dir;
}
info->working_dir = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
info->working_dir = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (!info->working_dir)
return E_OUTOFMEMORY;