setupapi: Handle NULL source filename in build_filepathsW.

Source filename is NULL for files to be deleted.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2020-12-07 17:53:01 +01:00 committed by Alexandre Julliard
parent 183a8cf380
commit fac1e40aaf
1 changed files with 2 additions and 2 deletions

View File

@ -152,7 +152,7 @@ static BOOL build_filepathsW( const struct file_op *op, FILEPATHS_W *paths )
unsigned int src_len = 1, dst_len = 1;
WCHAR *source = (PWSTR)paths->Source, *target = (PWSTR)paths->Target;
if (op->src_file[0] != '@')
if (!op->src_file || op->src_file[0] != '@')
{
if (op->media) src_len += lstrlenW(op->media->root) + 1;
if (op->src_path) src_len += lstrlenW(op->src_path) + 1;
@ -174,7 +174,7 @@ static BOOL build_filepathsW( const struct file_op *op, FILEPATHS_W *paths )
paths->Target = target = HeapAlloc( GetProcessHeap(), 0, dst_len );
}
if (!source || !target) return FALSE;
if (op->src_file[0] != '@')
if (!op->src_file || op->src_file[0] != '@')
concat_W( source, op->media ? op->media->root : NULL, op->src_path, op->src_file );
else
lstrcpyW( source, op->src_file );