Commit fac1e40a authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

setupapi: Handle NULL source filename in build_filepathsW.

Source filename is NULL for files to be deleted. Signed-off-by: 's avatarHans Leidekker <hans@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 183a8cf3
......@@ -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 );
......
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