mirror of
https://github.com/reactos/reactos.git
synced 2026-06-01 00:40:26 +08:00
[COMCTL32] Fix a heap corruption in EDIT_EM_ReplaceSel (#7598)
https://jira.reactos.org/browse/CORE-19743
This commit is contained in:
@@ -2591,7 +2591,11 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r
|
||||
EDIT_CalcLineWidth_SL(es);
|
||||
/* remove chars that don't fit */
|
||||
if (honor_limit && !(es->style & ES_AUTOHSCROLL) && (es->text_width > fw)) {
|
||||
#ifdef __REACTOS__
|
||||
while ((es->text_width > fw) && s + strl > 0) {
|
||||
#else
|
||||
while ((es->text_width > fw) && s + strl >= s) {
|
||||
#endif
|
||||
lstrcpyW(es->text + s + strl - 1, es->text + s + strl);
|
||||
strl--;
|
||||
es->text_length = -1;
|
||||
|
||||
Reference in New Issue
Block a user