From f66f40ec4361f5cf997123d3ddf2f57fd6ae0fd5 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Mollazadeh Date: Fri, 3 Jul 2026 16:00:52 +0330 Subject: [PATCH] [RICHED20] Fix crash on copy (#9224) CORE-20482 The reason for the crash was a wrong sign extension being done when right-shifting an integer. Casting to an unsigned integer allows the correct zero-extension instead. Import patch from Wine 11.3: wine-mirror/wine@bb4ef1f (https://gitlab.winehq.org/wine/wine/-/merge_requests/9776) ``` riched20: Fix crash when copying text. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59005 wine commit id bb4ef1fbf7d8dae627025ea698c740cca8d15a06 by Piotr Caban ``` --- dll/win32/riched20/writer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dll/win32/riched20/writer.c b/dll/win32/riched20/writer.c index 70d5290b01e..e0230a9cbe8 100644 --- a/dll/win32/riched20/writer.c +++ b/dll/win32/riched20/writer.c @@ -686,8 +686,13 @@ static BOOL stream_out_para_props( ME_TextEditor *editor, ME_OutStream *pStream, /* Word bar tab (vertical bar). Handled below */ break; } +#ifdef __REACTOS__ /* Import fix from Wine-11.3 */ + if ((ULONG)fmt->rgxTabs[i] >> 28 <= 5) + strcat(props, leader[(ULONG)fmt->rgxTabs[i] >> 28]); +#else if (fmt->rgxTabs[i] >> 28 <= 5) strcat(props, leader[fmt->rgxTabs[i] >> 28]); +#endif sprintf(props+strlen(props), "\\tx%ld", fmt->rgxTabs[i]&0x00FFFFFF); } }