The absolute dirid (-1) is an empty string and should not have a backslash appended to separate it from the filename; DestinationDirs with `-1` and a file spec like `c:\foo.bin` must remain as `c:\foo.bin` after `build_filepathsW`, it must not become `\c:\foo.bin`. This also fixes a undefined access to `buffer[-1]` when src2 is an empty string!
From: Anders Kjersem andersdev@proton.me
--- dlls/setupapi/queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c index 1c43808bc5f..144d128a52d 100644 --- a/dlls/setupapi/queue.c +++ b/dlls/setupapi/queue.c @@ -131,7 +131,7 @@ static void concat_W( WCHAR *buffer, const WCHAR *src1, const WCHAR *src2, const { lstrcpyW( buffer, src2 ); buffer += lstrlenW(buffer ); - if (buffer[-1] != '\') *buffer++ = '\'; + if (*src2 && buffer[-1] != '\') *buffer++ = '\'; *buffer = 0; if (src3) while (*src3 == '\') src3++; }