[PATCH] setupapi: Handle NULL source filename in build_filepathsW.

Hans Leidekker hans at codeweavers.com
Mon Dec 7 10:53:01 CST 2020


Source filename is NULL for files to be deleted.

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
---
 dlls/setupapi/queue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c
index 7ed66c298d3..dc718cc66fc 100644
--- a/dlls/setupapi/queue.c
+++ b/dlls/setupapi/queue.c
@@ -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 );
-- 
2.20.1




More information about the wine-devel mailing list