Re: [PATCH v29 0/1] MR9414: shlwapi: Handling of "C:\...xx" in PathCanonicalize[AW].
Yuxuan Shui (@yshui) commented about dlls/kernelbase/path.c:
+ if ((dst > buffer + 2) && dst[-2] == '\\' && dst[-1] == '.') { - src += 2; /* Skip .\ */ + dst -= 1; /* Skip .\ */ + src++; } - else if (src[1] == '.' && dst != buffer && dst[-1] == '\\') + else if ((dst > buffer + 4) && dst[-3] == '\\' && dst[-2] == '.' && dst[-1] == '.') { - /* \.. backs up a directory, over the root if it has no \ following X:. - * .. is ignored if it would remove a UNC server name or initial \\ - */ - if (dst != buffer) + /* \.. backs up a directory */ + dst -= 4; + while (dst > buffer && *dst != '\\') Are we worried about backing up over a device letter in this case? i.e. `C:\\..\\something`
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9414#note_126502
participants (1)
-
Yuxuan Shui (@yshui)