[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 <[email protected]>
```
This commit is contained in:
Mohammad Amin Mollazadeh
2026-07-03 14:30:52 +02:00
committed by GitHub
parent 6d8a5fa0bb
commit f66f40ec43
+5
View File
@@ -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);
}
}