[PATCH 0/1] MR7688: Setupapi: Don't add backslash on absolute dirid
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! -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7688
From: Anders Kjersem <andersdev(a)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++; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7688
participants (2)
-
Anders Kjersem -
Anders Kjersem (@anders)