msi: Add a NULL terminator to file->dest after reallocation.

This commit is contained in:
James Hawkins 2009-12-07 19:55:32 -08:00 committed by Alexandre Julliard
parent b13803ea40
commit d90aca35c4
1 changed files with 5 additions and 0 deletions

View File

@ -5288,6 +5288,11 @@ static BOOL move_files_wildcard(LPWSTR source, LPWSTR dest, int options)
goto done; goto done;
} }
/* file->dest may be shorter after the reallocation, so add a NULL
* terminator. This is needed for the call to strrchrW, as there will no
* longer be a NULL terminator within the bounds of the allocation in this case.
*/
file->dest[size - 1] = '\0';
lstrcpyW(strrchrW(file->dest, '\\') + 1, file->destname); lstrcpyW(strrchrW(file->dest, '\\') + 1, file->destname);
while (!list_empty(&files.entry)) while (!list_empty(&files.entry))