[PATCH 0/1] MR5855: winex11: Fix chinese path failure of conversion.
Chinese word is negative, the high 4 bits are signed, right shift will remain signed,high 4 bits is filled by 1. Finally it will exceed the boundaries of hax_table. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/5855
From: Haoyang Chen <chenhaoyang(a)kylinos.cn> Chinese word is negative, the high 4 bits are signed, right shift will remain signed,high 4 bits is filled by 1. Finally it will exceed the boundaries of hax_table. --- dlls/winex11.drv/clipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 087e0aab79b..4c9672f216f 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -1622,7 +1622,7 @@ static BOOL export_hdrop( Display *display, Window win, Atom prop, Atom target, { static const char hex_table[] = "0123456789abcdef"; textUriList[next++] = '%'; - textUriList[next++] = hex_table[unixFilename[u] >> 4]; + textUriList[next++] = hex_table[(unsigned char)unixFilename[u] >> 4]; textUriList[next++] = hex_table[unixFilename[u] & 0xf]; } textUriList[next++] = '\r'; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/5855
participants (2)
-
Haoyang Chen -
Haoyang Chen (@chenhaoyang)