Skip to content

Commit be7d797

Browse files
authored
[COMCTL32] Fix a heap corruption in EDIT_EM_ReplaceSel (reactos#7598)
https://jira.reactos.org/browse/CORE-19743
1 parent 35ca454 commit be7d797

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dll/win32/comctl32/edit.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2591,7 +2591,11 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r
25912591
EDIT_CalcLineWidth_SL(es);
25922592
/* remove chars that don't fit */
25932593
if (honor_limit && !(es->style & ES_AUTOHSCROLL) && (es->text_width > fw)) {
2594+
#ifdef __REACTOS__
2595+
while ((es->text_width > fw) && s + strl > 0) {
2596+
#else
25942597
while ((es->text_width > fw) && s + strl >= s) {
2598+
#endif
25952599
lstrcpyW(es->text + s + strl - 1, es->text + s + strl);
25962600
strl--;
25972601
es->text_length = -1;

0 commit comments

Comments
 (0)